skill & docs
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 23s
POC GitOps E2E / e2e (push) Successful in 53s
unit-tests Bats test report
CI Feature / Bats tests (push) Failing after 1m32s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Failing after 1m45s
CI Feature / Report Summary (push) Successful in 5s
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 23s
POC GitOps E2E / e2e (push) Successful in 53s
unit-tests Bats test report
CI Feature / Bats tests (push) Failing after 1m32s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Failing after 1m45s
CI Feature / Report Summary (push) Successful in 5s
This commit is contained in:
+25
-4
@@ -113,17 +113,38 @@ Lukee tiedoston polun `CI_CONF_FILE`-env-muuttujasta (oletus: `.gitea/workflows/
|
||||
Dispatchaa workflow'n toisessa repossa ja pollaa sen valmistumista synkronisesti.
|
||||
Käytetään GitOps-deploymentissa ja klusteritestien ketjutuksessa (tuleva).
|
||||
|
||||
Generoi automaattisesti `dispatch_id`-tunnisteen, lisää sen dispatch-
|
||||
inputteihin ja tunnistaa workflow-runin kohdereposta `display_title`-
|
||||
kentän perusteella. Toimii luotettavasti vaikka samassa repossa olisi
|
||||
useita samanaikaisia ajoja.
|
||||
|
||||
**Kohde-workflow'ssa on oltava `dispatch_id`-input ja `run-name`-kenttä
|
||||
`display_title`-matchausta varten.** Katso `skills/gitops-update/SKILL.md`.
|
||||
|
||||
### Rajapinta
|
||||
|
||||
```bash
|
||||
dispatch-workflow.sh <target_repo> <workflow_file> <ref> <inputs_json> [timeout_minutes]
|
||||
dispatch-workflow.sh <target_repo> <workflow_file> <ref> <inputs_json> <gitea_api_url> <gitea_token> [timeout_minutes]
|
||||
```
|
||||
|
||||
| Parametri | Pakollinen | Kuvaus |
|
||||
|-----------|------------|--------|
|
||||
| `target_repo` | Kyllä | `owner/repo` |
|
||||
| `workflow_file` | Kyllä | Workflow-tiedosto (esim. `ci-main.yml`) |
|
||||
| `ref` | Kyllä | Branch |
|
||||
| `inputs_json` | Kyllä | JSON-objekti dispatch-inputteina |
|
||||
| `gitea_api_url` | Kyllä | Gitean API-URL |
|
||||
| `gitea_token` | Kyllä | Gitea API -token (write kohderepoon) |
|
||||
| `timeout_minutes` | Ei | Aikakatkaisu (oletus 360) |
|
||||
|
||||
### Toiminta
|
||||
|
||||
1. **Dispatch:** `POST /api/v1/repos/{target_repo}/actions/workflows/{workflow_file}/dispatches`
|
||||
2. **Poll:** `GET /api/v1/repos/{target_repo}/actions/runs` → odota valmistumista
|
||||
3. **Palauta:** `conclusion` (`success`/`failure`/`timeout`)
|
||||
1. **Generoi `dispatch_id`** — 8-hex uniikki tunniste
|
||||
2. **Injektoi** `dispatch_id` inputteihin
|
||||
3. **Dispatch:** `POST /api/v1/repos/{target_repo}/actions/workflows/{workflow_file}/dispatches`
|
||||
4. **Etsi run:** pollaa rinnakkaisia `workflow_dispatch`-runeja, matchaa `display_title` sisältää `dispatch_id`:n
|
||||
5. **Poll:** `GET /api/v1/repos/{target_repo}/actions/runs/{run_id}` — odota valmistumista
|
||||
6. **Palauta:** exit 0 (success), exit 1 (failure), exit 124 (timeout)
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user