This commit is contained in:
parent
a1e8a3859d
commit
71a7eeafae
1 changed files with 18 additions and 9 deletions
27
README.md
27
README.md
|
@ -11,7 +11,7 @@ It has 4 standard entry points, defined in `pyproject.toml`:
|
||||||
|
|
||||||
## CI
|
## CI
|
||||||
|
|
||||||
It has a Forgejo CI build action, defined in `.forgejo/actions/build.yaml`.
|
It has a *Forgejo* CI build action, defined in `.forgejo/actions/build.yaml`.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ set DNAME (echo $NAME | tr "_" "-")
|
||||||
```
|
```
|
||||||
|
|
||||||
or with bash:
|
or with bash:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
NAME=foo
|
NAME=foo
|
||||||
PNAME=knoc_$NAME
|
PNAME=knoc_$NAME
|
||||||
|
@ -33,6 +34,7 @@ DNAME=$(echo $NAME | tr "_" "-")
|
||||||
```
|
```
|
||||||
|
|
||||||
Then:
|
Then:
|
||||||
|
|
||||||
```fish
|
```fish
|
||||||
git clone https://code.philo.ydns.eu/K-Net/knoc-plugin-template.git $DNAME
|
git clone https://code.philo.ydns.eu/K-Net/knoc-plugin-template.git $DNAME
|
||||||
cd $DNAME
|
cd $DNAME
|
||||||
|
@ -45,37 +47,44 @@ sed "s/plugin_template/$NAME/" -i src/$PNAME/cli.py
|
||||||
sed "s/plugin_template/$NAME/" -i src/$PNAME/settings.py
|
sed "s/plugin_template/$NAME/" -i src/$PNAME/settings.py
|
||||||
sed "s/plugin_template/$NAME/" -i src/$PNAME/workflows.py
|
sed "s/plugin_template/$NAME/" -i src/$PNAME/workflows.py
|
||||||
uv venv
|
uv venv
|
||||||
git init
|
git init # Forgejo inits repo with a branch `main`, so it might be a good idea to stick wit this convention
|
||||||
|
git branch -m master main
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, with `fish`:
|
Then, with `fish`:
|
||||||
|
|
||||||
```fish
|
```fish
|
||||||
. .venv/bin/activate.fish
|
. .venv/bin/activate.fish
|
||||||
uv sync
|
uv sync
|
||||||
```
|
```
|
||||||
|
|
||||||
Or `bash`:
|
Or `bash`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
. .venv/bin/activate
|
. .venv/bin/activate
|
||||||
uv sync
|
uv sync
|
||||||
|
git add --all
|
||||||
|
git commit -m "Initial commit"
|
||||||
```
|
```
|
||||||
|
|
||||||
=> The package is ready.
|
=> The package is ready.
|
||||||
|
|
||||||
In a *knoc* development environment:
|
In a *knoc* development environment:
|
||||||
|
|
||||||
```fish
|
```fish
|
||||||
uv pip install -e ../$DNAME
|
uv pip install -e ../$DNAME
|
||||||
knoc # Should display the new plugin's CLI tool
|
knoc # Should display the new plugin's CLI tool
|
||||||
```
|
```
|
||||||
|
|
||||||
Finally, create a repo with the same name in the central repo (*forgejo*) and the git upstream.
|
## Develop
|
||||||
|
|
||||||
*Forgejo* inits repo with a branch `main` to it might be useful to run:
|
* Edit
|
||||||
|
*`git commit`
|
||||||
|
*`git tag` (for versioning: `git tag -a v0.1.2 -m "..."`)
|
||||||
|
* `git push`
|
||||||
|
|
||||||
```fish
|
## Deploy
|
||||||
git branch -m master main
|
|
||||||
```
|
|
||||||
|
|
||||||
, edit, commit, tag, push.
|
To add the plugin in a production image, add the name to the `PLUGIN` variable
|
||||||
|
of the CI build tool, and deploy.
|
||||||
|
|
||||||
To add the plugin in a production image, add the name to the `PLUGIN` variable of the CI build tool, and deploy.
|
|
Loading…
Add table
Add a link
Reference in a new issue