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
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:
+47
-3
@@ -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 }}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user