poistettu turha pipeline tiedosto
This commit is contained in:
@@ -1,26 +0,0 @@
|
|||||||
name: CI Engine
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
config-file:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
secrets:
|
|
||||||
GITEA_TOKEN:
|
|
||||||
required: true
|
|
||||||
GIT_PAGES_PUBLISH_TOKEN:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
GITEA_API_URL: https://gitea.app.keskikuja.site
|
|
||||||
GIT_PAGES_URL: https://ci-reports.helm-dev.keskikuja.site
|
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
GIT_PAGES_PUBLISH_TOKEN: ${{ secrets.GIT_PAGES_PUBLISH_TOKEN }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Publish reports
|
|
||||||
run: bash scripts/publish.sh reports
|
|
||||||
@@ -10,14 +10,14 @@ Consumer kutsuu provideria `uses:`-viittauksella. Ei discoveryä — polku kovak
|
|||||||
### Polun muodostus
|
### Polun muodostus
|
||||||
|
|
||||||
```
|
```
|
||||||
{owner}/{repo}/.gitea/workflows/ci-engine.yml@{ref}
|
{owner}/{repo}/.gitea/workflows/build-feature.yml@{ref}
|
||||||
```
|
```
|
||||||
|
|
||||||
| Osa | Mistä | Esimerkki (homelab) |
|
| Osa | Mistä | Esimerkki (homelab) |
|
||||||
|-----|-------|---------------------|
|
|-----|-------|---------------------|
|
||||||
| `owner` | Repopolun ensimmäinen osa — **käyttäjänimi tai org** | `niko` |
|
| `owner` | Repopolun ensimmäinen osa — **käyttäjänimi tai org** | `niko` |
|
||||||
| `repo` | Repon nimi | `gitea-ci-library` |
|
| `repo` | Repon nimi | `gitea-ci-library` |
|
||||||
| tiedosto | Providerin workflow | `.gitea/workflows/ci-engine.yml` |
|
| tiedosto | Providerin workflow | `.gitea/workflows/build-feature.yml` |
|
||||||
| `@ref` | Tag tai branch provider-repossa | `@v1` (tuotanto) |
|
| `@ref` | Tag tai branch provider-repossa | `@v1` (tuotanto) |
|
||||||
|
|
||||||
**Owner ei ole org-pakotettu.** Homelabissa ei välttämättä ole organisaatiotasoa — silloin owner on
|
**Owner ei ole org-pakotettu.** Homelabissa ei välttämättä ole organisaatiotasoa — silloin owner on
|
||||||
@@ -36,7 +36,7 @@ Consumerin `ci.yml`:
|
|||||||
```yaml
|
```yaml
|
||||||
jobs:
|
jobs:
|
||||||
call-engine:
|
call-engine:
|
||||||
uses: niko/gitea-ci-library/.gitea/workflows/ci-engine.yml@v1
|
uses: niko/gitea-ci-library/.gitea/workflows/build-feature.yml@v1
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ niko/gitea-ci-library ←→ niko/gitea-ci-library (mirror tai push-mirror)
|
|||||||
niko/gitea-ci-library/... niko/gitea-ci-library/...
|
niko/gitea-ci-library/... niko/gitea-ci-library/...
|
||||||
```
|
```
|
||||||
|
|
||||||
Mirror pitää `ci-engine.yml`:n ja tagit (`v1`) saatavilla kulloisellakin palvelimella. Tämä korvaa
|
Mirror pitää `build-feature.yml`:n ja tagit (`v1`) saatavilla kulloisellakin palvelimella. Tämä korvaa
|
||||||
provider-repon checkout-hackit workflowissa — binding hoituu Gitean natiivilla `uses:`-mekanismilla.
|
provider-repon checkout-hackit workflowissa — binding hoituu Gitean natiivilla `uses:`-mekanismilla.
|
||||||
|
|
||||||
Periaatteet: [tmp/data-flow-design.md](tmp/data-flow-design.md)
|
Periaatteet: [tmp/data-flow-design.md](tmp/data-flow-design.md)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
## Päätös
|
## Päätös
|
||||||
|
|
||||||
Provider (gitea-ci-library) ja Consumer (mikropalveluprojekti) erotetaan
|
Provider (gitea-ci-library) ja Consumer (mikropalveluprojekti) erotetaan
|
||||||
selkeällä rajapinnalla: `.gitea/workflows/ci-engine.yml` on ainoa pinta,
|
selkeällä rajapinnalla: `.gitea/workflows/build-feature.yml` on ainoa pinta,
|
||||||
jota consumer kutsuu.
|
jota consumer kutsuu.
|
||||||
|
|
||||||
Kaikki muu providerin koodi (scriptit, git-pages-helmi, retention) on
|
Kaikki muu providerin koodi (scriptit, git-pages-helmi, retention) on
|
||||||
@@ -18,7 +18,7 @@ riippuvuutta.
|
|||||||
# .gitea/workflows/ci.yml — consumerin repo
|
# .gitea/workflows/ci.yml — consumerin repo
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
uses: niko/gitea-ci-library/.gitea/workflows/ci-engine.yml@v1
|
uses: niko/gitea-ci-library/.gitea/workflows/build-feature.yml@v1
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -44,13 +44,13 @@ Consumer:
|
|||||||
- Git-pages Helm-chartti
|
- Git-pages Helm-chartti
|
||||||
- Retention sidecar
|
- Retention sidecar
|
||||||
- Scriptit ja työkalut (toteutus avoin, uudelleenkirjoitettavissa)
|
- Scriptit ja työkalut (toteutus avoin, uudelleenkirjoitettavissa)
|
||||||
- Kaikki paitsi `ci-engine.yml` on sisäistä toteutusta ja voi muuttua
|
- Kaikki paitsi `build-feature.yml` on sisäistä toteutusta ja voi muuttua
|
||||||
ilman versiopäivitystä
|
ilman versiopäivitystä
|
||||||
|
|
||||||
## Periaatteet
|
## Periaatteet
|
||||||
|
|
||||||
1. `ci-engine.yml` on **lukittu rajapinta**. Consumer kutsuu tätä, ei
|
1. `build-feature.yml` on **lukittu rajapinta**. Consumer kutsuu tätä, ei
|
||||||
koskaan providerin scriptejä suoraan. `ci-engine.yml` voi muuttua vain
|
koskaan providerin scriptejä suoraan. `build-feature.yml` voi muuttua vain
|
||||||
version vaihtuessa.
|
version vaihtuessa.
|
||||||
2. Consumer omistaa pipeline-logiikan. Provider ei tiedä mitä testejä
|
2. Consumer omistaa pipeline-logiikan. Provider ei tiedä mitä testejä
|
||||||
ajetaan, missä järjestyksessä tai millä työkaluilla.
|
ajetaan, missä järjestyksessä tai millä työkaluilla.
|
||||||
|
|||||||
@@ -30,12 +30,12 @@ uses: org/repo/scripts/workflow.yml@branch
|
|||||||
```
|
```
|
||||||
|
|
||||||
Tästä syystä providerin reusable workflowt (`config-provider.yml`,
|
Tästä syystä providerin reusable workflowt (`config-provider.yml`,
|
||||||
`ci-engine.yml`) ovat samassa `.gitea/workflows/`-kansiossa consumerin
|
`build-feature.yml`) ovat samassa `.gitea/workflows/`-kansiossa consumerin
|
||||||
pipeline-tiedostojen (`ci.yml`, `build-feature.yml`) kanssa.
|
pipeline-tiedostojen (`ci.yml`) kanssa.
|
||||||
|
|
||||||
Erottelu on nimessä ja dokumentaatiossa, ei kansiorakenteessa:
|
Erottelu on nimessä ja dokumentaatiossa, ei kansiorakenteessa:
|
||||||
- `config-provider.yml`, `ci-engine.yml` — providerin tarjoamia
|
- `config-provider.yml`, `build-feature.yml` — providerin tarjoamia
|
||||||
- `ci.yml`, `build-feature.yml` — consumerin omistamia
|
- `ci.yml` — consumerin omistamia
|
||||||
|
|
||||||
## Providerin `scripts/` (juuressa)
|
## Providerin `scripts/` (juuressa)
|
||||||
|
|
||||||
|
|||||||
+5
-6
@@ -17,8 +17,7 @@ Tämä repo on käytännössä monorepo, jossa on kaksi itsenäistä osaa:
|
|||||||
|
|
||||||
### 1. Juuri (`gitea-ci-library`)
|
### 1. Juuri (`gitea-ci-library`)
|
||||||
Provider-kirjasto: reusable workflowt, scriptit, ADRt, dokumentaatio.
|
Provider-kirjasto: reusable workflowt, scriptit, ADRt, dokumentaatio.
|
||||||
Rajapinta: `.gitea/workflows/ci-engine.yml` — ainoa pinta, jota consumerit
|
Consumer kutsuu `build-feature.yml`-workflowa `uses:`-direktiivillä.
|
||||||
kutsuvat.
|
|
||||||
|
|
||||||
### 2. `git-pages/` — oma kokonaisuus
|
### 2. `git-pages/` — oma kokonaisuus
|
||||||
Helm-chartti Codeberg git-pagesille. Täysin itsenäinen — oma dokumentaatio,
|
Helm-chartti Codeberg git-pagesille. Täysin itsenäinen — oma dokumentaatio,
|
||||||
@@ -46,7 +45,7 @@ blob-arkkitehtuuri). Git-pages ei tiedä workflowista, scripteistä tai
|
|||||||
provider-logiikasta.
|
provider-logiikasta.
|
||||||
|
|
||||||
## Architecture (POC-tila)
|
## Architecture (POC-tila)
|
||||||
- **Provider & Consumer -malli**: `ci-engine.yml` on lukittu rajapinta.
|
- **Provider & Consumer -malli**: `build-feature.yml` on lukittu rajapinta.
|
||||||
ADR 0005.
|
ADR 0005.
|
||||||
- **Raporttien hostaus**: git-pages Helm-chartilla (`git-pages/`), `GIT_PAGES_URL` määrittää perusosoitteen.
|
- **Raporttien hostaus**: git-pages Helm-chartilla (`git-pages/`), `GIT_PAGES_URL` määrittää perusosoitteen.
|
||||||
- **Retention**: sidecar samassa podissa, HTTP API localhost:3000,
|
- **Retention**: sidecar samassa podissa, HTTP API localhost:3000,
|
||||||
@@ -59,19 +58,19 @@ provider-logiikasta.
|
|||||||
|
|
||||||
| Path | Purpose |
|
| Path | Purpose |
|
||||||
|---|---|
|
|---|---|
|
||||||
| `.gitea/workflows/` | `ci-engine.yml` (ainoa reusable workflow POC-vaiheessa) |
|
| `.gitea/workflows/` | Reusable workflowt (`build-feature.yml`, `config-provider.yml`) |
|
||||||
| `scripts/` | `publish-git-pages.sh`, `report-status.sh`, `dispatch-workflow.sh` |
|
| `scripts/` | `publish-git-pages.sh`, `report-status.sh`, `dispatch-workflow.sh` |
|
||||||
| **`git-pages/`** | **Oma kokonaisuus: Helm-chartti + docs + retention** |
|
| **`git-pages/`** | **Oma kokonaisuus: Helm-chartti + docs + retention** |
|
||||||
| `docs/` | Root-tason arkkitehtuuri, ADRt (0001–0005) |
|
| `docs/` | Root-tason arkkitehtuuri, ADRt (0001–0005) |
|
||||||
| `docs/adr/` | Architecture Decision Records |
|
| `docs/adr/` | Architecture Decision Records |
|
||||||
| `tests/` | Bats-testit skripteille |
|
| `tests/` | Bats-testit skripteille |
|
||||||
| `.gitea/workflows/ci.yml` | Dogfood — kutsuu `ci-engine.yml`:a |
|
| `.gitea/workflows/ci.yml` | Dogfood — kutsuu `build-feature.yml`:a |
|
||||||
|
|
||||||
**Tarkemmat git-pages-asiat:** `git-pages/docs/` (implementation-notes,
|
**Tarkemmat git-pages-asiat:** `git-pages/docs/` (implementation-notes,
|
||||||
architecture, design-rationale, secrets, tech-stack).
|
architecture, design-rationale, secrets, tech-stack).
|
||||||
|
|
||||||
## Key Technical Decisions
|
## Key Technical Decisions
|
||||||
- **Provider & Consumer**: `ci-engine.yml` lukittu rajapinta, muu koodi
|
- **Provider & Consumer**: `build-feature.yml` lukittu rajapinta, muu koodi
|
||||||
vapaasti muutettavissa
|
vapaasti muutettavissa
|
||||||
- **Vain Gitea, vain reusable workflowt**: ei custom actioneita, ei
|
- **Vain Gitea, vain reusable workflowt**: ei custom actioneita, ei
|
||||||
multi-platform
|
multi-platform
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
# Architecture — Gitea Actions CI -kirjasto
|
# Architecture — Gitea Actions CI -kirjasto
|
||||||
|
|
||||||
> ⚠️ POC-vaihe. Tämä dokumentti kuvaa suunniteltua arkkitehtuuria. Toteutus
|
> ⚠️ POC-vaihe. Tämä dokumentti kuvaa suunniteltua arkkitehtuuria.
|
||||||
> on edelleen kehitysvaiheessa (`ci-engine.yml` on ainoa reusable workflow).
|
|
||||||
> Odota uudelleenkirjoitusta ennen kuin luotat tähän dokumenttiin.
|
|
||||||
>
|
|
||||||
> Normatiivinen lähde: ADR 0004, ADR 0005, `docs/design-rationale.md`.
|
> Normatiivinen lähde: ADR 0004, ADR 0005, `docs/design-rationale.md`.
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -21,7 +18,7 @@ Kirjasto on Gitea-spesifi. Raportit hallinnoidaan git-pages Helm-chartilla
|
|||||||
|
|
||||||
| Rooli | Kuvaus |
|
| Rooli | Kuvaus |
|
||||||
|-------|--------|
|
|-------|--------|
|
||||||
| **Provider** | `gitea-ci-library` — tarjoaa `ci-engine.yml`:n (lukittu rajapinta) sekä scriptit |
|
| **Provider** | `gitea-ci-library` — tarjoaa `build-feature.yml` (lukittu rajapinta) sekä scriptit |
|
||||||
| **Consumer** | Mikropalveluprojekti — kutsuu `uses:`-direktiivillä, omistaa pipeline-logiikan |
|
| **Consumer** | Mikropalveluprojekti — kutsuu `uses:`-direktiivillä, omistaa pipeline-logiikan |
|
||||||
|
|
||||||
Tarkemmin: ADR 0005.
|
Tarkemmin: ADR 0005.
|
||||||
@@ -30,10 +27,10 @@ Tarkemmin: ADR 0005.
|
|||||||
|
|
||||||
| Komponentti | Tila |
|
| Komponentti | Tila |
|
||||||
|-------------|------|
|
|-------------|------|
|
||||||
| `ci-engine.yml` | Toimii POC-tasolla. Ainoa reusable workflow. |
|
| `build-feature.yml` | Toimii. Ainoa reusable workflow. |
|
||||||
| `publish-git-pages.sh` | Toimii. PATCH tar git-pagesiin. |
|
| `publish-git-pages.sh` | Toimii. PATCH tar git-pagesiin. |
|
||||||
| `report-status.sh` | Toimii. POSTaa commit-status (vain custom-linkkiin). |
|
| `report-status.sh` | Toimii. POSTaa commit-status (vain custom-linkkiin). |
|
||||||
| `dispatch-workflow.sh` | Suunniteltu, ei toteutettu POCissa. |
|
| `dispatch-workflow.sh` | Toimii. Dispatchee workflown ja pollaa valmistumista. |
|
||||||
| `git-pages/` | Helm-chartti raporttien hostaukseen. Oma kokonaisuus, tarkemmin: `git-pages/docs/`. |
|
| `git-pages/` | Helm-chartti raporttien hostaukseen. Oma kokonaisuus, tarkemmin: `git-pages/docs/`. |
|
||||||
|
|
||||||
## Ulkoiset palvelut
|
## Ulkoiset palvelut
|
||||||
@@ -43,10 +40,9 @@ Tarkemmin: ADR 0005.
|
|||||||
| **Gitea REST API** | Commit-status, workflow-dispatch, run-pollaus |
|
| **Gitea REST API** | Commit-status, workflow-dispatch, run-pollaus |
|
||||||
| **Gitea Packages** | Docker-imagen säilytys |
|
| **Gitea Packages** | Docker-imagen säilytys |
|
||||||
| **git-pages** | Raporttien hostaus |
|
| **git-pages** | Raporttien hostaus |
|
||||||
| **SonarQube** | Koodin laadun analyysi (suunniteltu) |
|
|
||||||
|
|
||||||
## Arkkitehtuuriset rajoitteet
|
## Arkkitehtuuriset rajoitteet
|
||||||
|
|
||||||
- `ci-engine.yml` on ainoa consumerin kutsuma rajapinta (ADR 0005)
|
- `build-feature.yml` on ainoa consumerin kutsuma rajapinta (ADR 0005)
|
||||||
- Gitea Actionsin natiivi commit-status on ensisijainen (ADR 0004)
|
- Gitea Actionsin natiivi commit-status on ensisijainen (ADR 0004)
|
||||||
- Raportit ovat julkisia URL:lla (osoite tunnettava)
|
- Raportit ovat julkisia URL:lla (osoite tunnettava)
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
# Reusable workflowt
|
# Reusable workflowt
|
||||||
|
|
||||||
> ⚠️ **POC-vaihe.** Tämä dokumentti kuvaa suunniteltuja workflow'ta
|
> ⚠️ **POC-vaihe.** Tämä dokumentti kuvaa suunniteltuja workflow'ta
|
||||||
> (ci-feature, ci-master, deploy, test). POCissa on toteutettu vain
|
> (ci-feature, ci-master, deploy, test). POCissa on toteutettu
|
||||||
> `ci-engine.yml`. Uudelleenkirjoitus odottaa.
|
> `build-feature.yml`. Uudelleenkirjoitus odottaa.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user