feat: Woodpecker-Plugin deploy für oumta-deploy (#1)

## Was

Woodpecker-Plugin `deploy` (`git.uesome.de/actions/ci-cd/deploy`): schreibt ein gepushtes dev- oder beta-Image mit Digest nach `tanztee/oumta-deploy`. Die Umgebung entscheidet dort `ci/deploy-image.sh` anhand des Tags (`-dev.` → dev, `-beta.` → beta, sonst nichts; prod nur per PR). Digest per `crane`, kein Docker-Daemon nötig (dafür tanztee/oumta-deploy#20).

- `woodpecker/deploy/`: Dockerfile (`alpine:3.20`, bash, git, crane) und `deploy.sh`
- `.woodpecker/plugins.yaml`: Push/PR mit Änderungen unter `woodpecker/deploy/**` → nur Probe-Build (`dry_run`, ohne Secrets); Tag `deploy-vX.Y.Z` → Push als `:vX.Y.Z`
- `README.md`: Abschnitt „Woodpecker plugins“ mit Settings und Beispiel

Das Token von `oumta-ci` steht nur im Credential-Helper, nicht in URL oder Config.

## Getestet (lokal, crane als Stub, gegen Kopie von oumta-deploy `a74c73d`)

| Fall | Ergebnis |
| --- | --- |
| `v2.0.1-dev.…`, `AUTH_IMAGE` | `deploy(dev): oumta-auth …` |
| `v2.0.9-beta.7`, `APP_V{major}_IMAGE` | `APP_V2_IMAGE` in beta |
| `v2.0.1` | nichts zu tun, Exit 0 |
| keyklo, `envs: dev beta` | zwei Commits |
| gleicher Tag erneut | „bereits aktuell“ |
| ohne `deploy_token` | Abbruch mit Meldung |

Offen: echter Lauf gegen Registry und Gitea per HTTPS.

## Vor dem ersten Lauf in Woodpecker

1. `actions/ci-cd` aktivieren.
2. Repo-Secrets `registry_username`/`registry_password` (Schreibrecht auf Pakete der Org `actions`), nur Event `tag`, nur Image `woodpeckerci/plugin-docker-buildx`.
3. Prüfen, ob `plugin-docker-buildx:6.1.2` privilegiert laufen darf (`WOODPECKER_PLUGINS_PRIVILEGED`).

Tag `deploy-v1.0.0` erst nach dem Merge und grünem Probe-Build.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
tu committed 2026-10-30 14:23:43 +00:00
1 parent 662db558bd
commit d071358196
4 files changed
+124

No files matched your search

+51
View File
@@ -117,3 +117,54 @@ jobs:
kubeconfig: ${{ secrets.KUBECONFIG }}
registry: ${{ secrets.REGISTRY }}
```
## Woodpecker plugins
Plugins are Docker images built from `woodpecker/<name>/` by `.woodpecker/plugins.yaml`. A tag `<name>-vX.Y.Z` publishes `git.uesome.de/actions/ci-cd/<name>:vX.Y.Z`; pipelines pin that version.
### deploy
Writes a pushed dev or beta image with its digest to `tanztee/oumta-deploy` (D16 there). `ci/deploy-image.sh` in oumta-deploy decides the environment from the tag: `-dev.` goes to dev, `-beta.` to beta, anything else is skipped (prod only via PR).
Settings:
- `var` (required): variable in `envs/<env>/images.env`, e.g. `AUTH_IMAGE`. `{major}` is replaced by the major of the tag (`APP_V{major}_IMAGE` -> `APP_V2_IMAGE`).
- `deploy_token` (required): token of `oumta-ci`, write access to oumta-deploy only. Limit the secret to this image and the events `tag` and `manual`.
- `registry_username`, `registry_password`: read access to the registry for the digest
- `envs`: fixed environments instead of the tag rule, e.g. `dev beta` (oumta-keyklo)
- `tag`: default `CI_COMMIT_TAG`
- `registry`: default `git.uesome.de`
- `image`: default `<registry>/<CI_REPO>`
- `deploy_user`: default `oumta-ci`
- `deploy_repo`: default `https://git.uesome.de/tanztee/oumta-deploy.git`
Example:
```yaml
when:
event: tag
ref: refs/tags/v*
steps:
- name: build
image: woodpeckerci/plugin-docker-buildx:6.1.2
settings:
registry: git.uesome.de
repo: git.uesome.de/tanztee/oumta-auth
tags: ${CI_COMMIT_TAG}
username:
from_secret: registry_username
password:
from_secret: registry_password
- name: deploy
image: git.uesome.de/actions/ci-cd/deploy:v1.0.0
settings:
var: AUTH_IMAGE
registry_username:
from_secret: registry_username
registry_password:
from_secret: registry_password
deploy_token:
from_secret: oumta_deploy_token
```