gitops init
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 24s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Failing after 1m10s
unit-tests Bats test report
CI Feature / Bats tests (push) Successful in 1m35s
CI Feature / Report Summary (push) Successful in 6s

This commit is contained in:
moilanik
2026-06-21 15:44:31 +03:00
parent a5947551d4
commit 86e73d87d3
8 changed files with 388 additions and 4 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ organization/repository secrets -mekanismissa ja välitetään workflowlle
| Secret | Pakollinen | Käyttäjä |
|---|---|---|
| `GITEA_TOKEN` | Kyllä | `report-status.sh`, `check-version.yml`, `docker-build-push.yml` |
| `GITEA_TOKEN` | Kyllä | `report-status.sh`, `check-version.yml`, `docker-build-push.yml`, `gitops-update.sh` |
| `GIT_PAGES_PUBLISH_TOKEN` | Kyllä | `publish-git-pages.sh`, `config-provider.yml` (validointi) |
| `DOCKER_USERNAME` | Ei | `docker-build-push.yml` (oletus: `github.actor`, ei pakollinen kaikissa registryissä) |
| `DOCKER_PASSWORD` | Kyllä | `docker-build-push.yml` |
+47 -3
View File
@@ -182,7 +182,51 @@ Forward-compatibeli — ei haittaa vanhemmilla Gitea-versioilla.
---
## Suunnitteilla
## Provider-skriptit
- `deploy.yml` — GitOps-deployment (dispatch-workflow.sh-pohjainen)
- `test.yml` — Klusteritason test flow
### `gitops-update.sh` — GitOps-version päivitys
**Riippuvuudet:** `yq`, `scripts/report-status.sh`, `git`
Päivittää GitOps-repon konfiguraatiotiedoston versionumeron `yq`:lla,
committaa muutoksen ja asettaa commit-statuksen molempiin repoihin.
**Input-ympäristömuuttujat:**
| Muuttuja | Pakollinen | Kuvaus |
|---|---|---|
| `INPUT_FILE` | Kyllä | Tiedosto GitOps-repossa (esim. `dev/Chart.yaml`) |
| `YQ_TPL` | Kyllä | `yq`-lauseke `{{VERSION}}`-placeholderilla |
| `VERSION` | Kyllä | Uusi versio (esim. `0.2.3`) |
| `SOURCE_REPO` | Kyllä | Lähdekoodirepo (esim. `org/app`) |
| `SOURCE_COMMIT` | Kyllä | Lähdekoodin commit-SHA |
| `GITOPS_REPO` | Kyllä | GitOps-konfiguraatiorepo (esim. `org/app-gitops`) |
| `GITEA_API_URL` | Kyllä | Gitean API-URL |
| `GITEA_TOKEN` | Kyllä | Gitea API-token |
| `GITOPS_BRANCH` | Ei | GitOps-repon branch (oletus `main`) |
**Steppikuvaus:**
1. Korvaa `YQ_TPL`:n `{{VERSION}}` versiolla
2. Muodostaa `CLONE_URL` tokenilla ja hostilla
3. Kloonaa GitOps-repon
4. Ajaa `yq eval -i` päivittääkseen tiedoston
5. Commit + push `[skip ci]`
6. Asettaa commit-statuksen: code-repoon (gitops-konteksti) ja GitOps-repoon (source-konteksti)
**Esimerkki dispatchistä:**
```yaml
- name: Update GitOps
run: |
export INPUT_FILE=dev/Chart.yaml
export YQ_TPL='(.version) = "{{VERSION}}"'
export VERSION=0.2.3
export SOURCE_REPO=org/app
export SOURCE_COMMIT=${{ github.sha }}
export GITOPS_REPO=org/app-gitops
bash scripts/gitops-update.sh
env:
GITEA_API_URL: ${{ vars.GITEA_API_URL }}
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
```
---