docs: README + DEPLOYMENT con stato CI/CD funzionante
ci / ruff lint (push) Successful in 14s
ci / mypy mcp_common (push) Successful in 23s
ci / pytest (push) Successful in 30s
ci / validate compose + Caddyfile (push) Successful in 2m2s
ci / build & push to registry (push) Successful in 1m32s

README aggiunge sezione 'CI/CD pipeline' che descrive i 5 job e i tag
image. DEPLOYMENT espande sez. 1 con dettagli runner Gitea (network
gitea_gitea-internal, image runner-images, label ubuntu-latest) e
configurazione secret user-level REGISTRY_TOKEN con scope write:package.
This commit is contained in:
AdrianoDev
2026-04-29 09:18:30 +02:00
parent 2fb7043790
commit 019b7e3298
2 changed files with 60 additions and 17 deletions
+36 -11
View File
@@ -23,19 +23,44 @@ Watchtower per il rollover automatico delle versioni.
## 1. Pipeline CI/CD (Gitea Actions)
`.gitea/workflows/ci.yml` ad ogni push su `main` esegue, in sequenza:
`.gitea/workflows/ci.yml` ad ogni push su `main` esegue 5 job:
1. **lint** (`ruff check`) — gating
2. **typecheck** (`mypy mcp_common`) — gating su mcp_common, warn-only sui servizi
3. **test** (`pytest services/`) — gating, 455 test
4. **build-and-push** — solo su push a `main`:
- Logga al registry `git.tielogic.xyz` con `secrets.GITEA_TOKEN`
- Builda `docker/base.Dockerfile` (cache)
- Builda e pusha `gateway` + 6 servizi MCP con tag:
- `:latest` (mobile, Watchtower polla questo)
- `:sha-XXXXXXX` (immutabile, per rollback puntuali)
1. **lint** (`ruff check services/`) — gating, 0 violations.
2. **typecheck** (`mypy services/common/src/mcp_common`) — gating sul
modulo comune, warn-only sui servizi.
3. **test** (`pytest services/`) — gating, 478 test verdi.
4. **validate-config**`docker compose config -q` su `docker-compose.yml`
e `docker-compose.prod.yml` + `caddy validate --config Caddyfile`.
5. **build-and-push** — solo su push a `main` (skip su PR):
- `docker login git.tielogic.xyz` con `${{ secrets.REGISTRY_TOKEN }}`
(PAT scope `write:package`, configurato user-level su Gitea).
- Builda e pusha **8 image** al registry con tag `:latest` + `:sha-X`:
- `git.tielogic.xyz/adriano/cerbero-mcp/base`
- `git.tielogic.xyz/adriano/cerbero-mcp/gateway`
- `git.tielogic.xyz/adriano/cerbero-mcp/mcp-{deribit,bybit,hyperliquid,alpaca,macro,sentiment}`
- Cache Docker buildx via registry stesso (`buildcache:<name>` per ognuna)
→ run successivi 5-10× più veloci.
Le PR fanno girare solo lint+typecheck+test, niente build/push.
Le PR fanno girare solo `lint`+`typecheck`+`test`+`validate-config`,
niente build/push (gating per merge).
### Setup runner Gitea
Il runner act_runner deve girare:
- Sulla stessa Docker network di Gitea (`gitea_gitea-internal` o equivalente)
altrimenti `actions/checkout@v4` non risolve `gitea:3000` per il clone.
- Con bind di `/var/run/docker.sock` per buildare image dai workflow.
- Image dei job mappata a `docker.gitea.com/runner-images:ubuntu-22.04`
(default Gitea, contiene docker CLI + buildx + git + curl + node).
- Label: almeno `ubuntu-latest` (usato dal workflow). Altre label
(`tielogic-ci`, `ubuntu-22.04`, ecc.) opzionali.
### Setup secret REGISTRY_TOKEN
Crea un Personal Access Token Gitea con scope `write:package` (User
Settings → Applications → Generate Token). Aggiungilo come secret a
livello user (User Settings → Secrets → New Secret) con nome
`REGISTRY_TOKEN`. Tutti i tuoi repo ereditano il secret automaticamente.
## 2. Setup iniziale del VPS