98 lines
2.6 KiB
Markdown
98 lines
2.6 KiB
Markdown
# CI-BASELINE — Gitea Actions + runner Synology (DS220+)
|
||
|
||
Baseline VALIDÉE :
|
||
- runner : container.network = host
|
||
- job CI : container Node 22 (conforme engines)
|
||
- checkout : sans GitHub, basé sur workflow/event.json
|
||
- zéro apt-get dans le workflow
|
||
- durcissement DNS Node : NODE_OPTIONS=--dns-result-order=ipv4first
|
||
|
||
## Runner (DS220+) — configuration de référence
|
||
|
||
Fichier : /data/config.yaml dans le conteneur runner (ex: gitea-act-runner)
|
||
|
||
Section container attendue :
|
||
|
||
container:
|
||
network: host
|
||
options: >-
|
||
--add-host=gitea.archicratie.trans-hands.synology.me:192.168.1.20
|
||
-e NODE_OPTIONS=--dns-result-order=ipv4first
|
||
|
||
Pourquoi : sur cette infra, le DNS du bridge Docker (127.0.0.11) a généré ESERVFAIL / EAI_AGAIN / apt qui ne résout pas.
|
||
Le host network stabilise les résolutions (npm registry, deb.debian.org, etc.).
|
||
|
||
## Smoke test NAS (doit passer)
|
||
|
||
docker run --rm --network host mcr.microsoft.com/devcontainers/javascript-node:22-bookworm bash -lc "npm ping --registry=https://registry.npmjs.org"
|
||
|
||
## Symptômes -> cause -> action
|
||
|
||
- EAI_AGAIN / ESERVFAIL : runner pas en host network -> remettre container.network: host + restart runner
|
||
- EBADENGINE : mauvais Node -> container Node 22
|
||
- MODULE_NOT_FOUND scripts/check-anchor-aliases.mjs : fichier non commité -> git add/commit/push
|
||
|
||
______________________________________________
|
||
|
||
Dernière mise à jour : 2026-01-29
|
||
|
||
But : définir un minimum “incassable” (local + runner) qui garantit :
|
||
- build OK
|
||
- anchors cohérents
|
||
- aliases injectés
|
||
- dist propre (pas d’IDs dupliqués)
|
||
- pagefind généré
|
||
|
||
---
|
||
|
||
## 1) Commande canonique
|
||
|
||
en bash :
|
||
npm test
|
||
|
||
## 2) Ce que npm test enchaîne
|
||
|
||
npm run test:aliases
|
||
|
||
npm run build
|
||
|
||
npm run audit:dist
|
||
|
||
node scripts/verify-anchor-aliases-in-dist.mjs
|
||
|
||
npm run test:anchors
|
||
|
||
node scripts/check-inline-js.mjs
|
||
|
||
## 3) Smoke test “prod-like” (Nginx statique)
|
||
|
||
Sur NAS (ou local), quand on a un service qui expose un port HTTP :
|
||
./scripts/smoke.sh 8081
|
||
./scripts/smoke.sh 8082
|
||
|
||
Attendus :
|
||
|
||
/ répond 200
|
||
|
||
/pagefind/pagefind.js répond 200
|
||
|
||
## 4) Note DSM 7.3 (DS220+) — build réseau
|
||
|
||
Sur Synology, il arrive que docker build ait des soucis DNS/apt/npm.
|
||
On force un build stable :
|
||
|
||
BuildKit :
|
||
export DOCKER_BUILDKIT=1
|
||
export COMPOSE_DOCKER_CLI_BUILD=1
|
||
|
||
build en réseau host (dans docker-compose.yml) :
|
||
build:
|
||
network: host
|
||
|
||
## 5) Avertissement “git was not found”
|
||
|
||
BuildKit affiche parfois :
|
||
buildx: git was not found ... commit information was not captured
|
||
|
||
Ce warning est sans impact sur le build du site (il concerne juste la capture d’infos de commit).
|