Date : 21/01/2026 22:30 Status : TERMINE Duree : ~2h
Migrer le projet ai-orchestrator vers le nouveau systeme Smart-Deploy avec template ci-templates.
Plusieurs problemes ont ete identifies et corriges :
| Probleme | Solution |
|---|---|
| Projet ci-templates private | Change en internal via API |
| Image docker:27 sans bash | Ajout apk add bash jq curl openssh-client |
| Client docker trop vieux (debian) | Utilisation image docker:27 |
| Registry access forbidden | Ajout docker login avec CI_JOB_TOKEN |
| SSH vers nginx impossible | Mount /root/.ssh dans config runner |
| scp "hostname invalid characters" | Redirect logs vers stderr dans nginx.sh |
| Check config existe (symlinks) | Utiliser [ -e ] au lieu de [ -f ] |
Strategie implementee dans docker.sh :
Ajout de deploy_strategy dans conf.gouroubleu.yml :
# Zero-downtime (blue-green)
deploy_strategy: "zero-downtime" # ou "zdt"
# Simple (stop → start, quelques secondes downtime)
deploy_strategy: "simple" # defaut
conf.prod.gouroubleu.yml.gitlab-ci.yml par include ci-templatesconf.prod.gouroubleu.yml :
name: "ai-orchestrator"
target: "prod-portainer"
type: "node"
domain: "ai-orchestrator.33800.nowhere84.com"
port: 5501
deploy_strategy: "zero-downtime"
services:
- ntfy
env:
WIN11_HOST: "192.168.1.30"
WIN11_USER: "gouro"
volumes:
- /home/gouroubleu/.ssh:/home/appuser/.ssh:ro
- /mnt/stock_8to/33800-stack/ai-data:/mnt/stock_8to/33800-stack/ai-data
health: "/health"
nginx:
enabled: true
ssl: true
logs:
enabled: true
driver: loki
.gitlab-ci.yml :
include:
- project: 'gouroubleu/ci-templates'
file: '/deploy.yml'
.deploy-base:
stage: deploy
tags:
- prod-runner
image: docker:27
before_script:
- apk add --no-cache bash jq curl openssh-client > /dev/null
- echo "$CI_JOB_TOKEN" | docker login -u gitlab-ci-token --password-stdin registry.33800.nowhere84.com
- echo "=== Deploiement ${CI_PROJECT_NAME} (${CI_COMMIT_BRANCH}) ==="
- echo " Commit ${CI_COMMIT_SHORT_SHA}"
- echo " Config ${DEPLOY_CONFIG}"
script:
- bash /mnt/stock_8to/33800-stack/scripts/deploy/smart-deploy.sh
after_script:
- bash /mnt/stock_8to/33800-stack/scripts/deploy/notify-result.sh || true
| Fichier | Modifications |
|---|---|
/tmp/ci-templates-fix/deploy.yml |
Image docker:27, apk add, docker login |
/etc/gitlab-runner/config.toml |
Mount SSH keys /root/.ssh |
scripts/deploy/strategies/docker.sh |
Zero-downtime + simple strategies |
scripts/deploy/lib/nginx.sh |
Stderr redirects, symlink check |
| Strategie | Config | Downtime | Usage |
|---|---|---|---|
| simple | deploy_strategy: "simple" |
Quelques secondes | Services non critiques |
| zero-downtime | deploy_strategy: "zero-downtime" |
Aucun | APIs critiques |
Migrer les autres projets un par un :