fix(deploy): déléguer le redéploiement dashboard recette à l hôte

This commit is contained in:
Manus AI
2026-08-18 08:59:23 +00:00
parent 87cc629d81
commit 5105123ec4
10 changed files with 2562 additions and 4 deletions

View File

@@ -6,6 +6,8 @@ Le dernier rapport est écrit dans `/var/lib/manus-apps-health/latest.txt`. Les
Le runner de recette est installé par `install-gitea-act-runner.sh`. Il construit une image locale Node 20 avec Bash, puis s’enregistre auprès de Gitea avec un jeton éphémère. Les workflows s’exécutent ensuite dans cette image isolée sur le réseau Docker `web`.
Les pushes du dépôt `manus-dashboard` créent une demande atomique prise en charge par `manus-dashboard-self-deploy.path`. Le conteneur ne se redéploie donc jamais lui-même : le service systemd hôte effectue le build et le démarrage du remplacement.
Après mise à jour Git, installer ou actualiser le service avec :
```bash

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# Le dashboard est redéployé par l’hôte, jamais par le conteneur qu’il remplace.
set -Eeuo pipefail
readonly APP_DIR="/opt/manus-deploy/apps/manus-dashboard"
readonly REQUEST_FILE="${APP_DIR}/.deployment-request"
readonly PROCESSING_FILE="${APP_DIR}/.deployment-request.processing"
readonly LOCK_FILE="/run/manus-dashboard-self-deploy.lock"
exec 9>"${LOCK_FILE}"
flock -n 9 || exit 0
[[ -f "${REQUEST_FILE}" ]] || exit 0
mv "${REQUEST_FILE}" "${PROCESSING_FILE}"
restore_request() { [[ -f "${PROCESSING_FILE}" ]] && mv "${PROCESSING_FILE}" "${REQUEST_FILE}"; }
trap restore_request ERR
cd "${APP_DIR}"
git pull --ff-only origin main
docker compose up -d --build
rm -f "${PROCESSING_FILE}"
logger -p daemon.info -t manus-dashboard-self-deploy "Dashboard redéployé depuis le service hôte"

View File

@@ -7,9 +7,13 @@ readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
install -D -m 0750 "${SCRIPT_DIR}/healthcheck-apps.sh" /opt/manus-deploy/scripts/healthcheck-apps.sh
install -D -m 0644 "${SCRIPT_DIR}/manus-apps-health.service" /etc/systemd/system/manus-apps-health.service
install -D -m 0644 "${SCRIPT_DIR}/manus-apps-health.timer" /etc/systemd/system/manus-apps-health.timer
install -D -m 0750 "${SCRIPT_DIR}/deploy-dashboard-from-host.sh" /opt/manus-deploy/scripts/deploy-dashboard-from-host.sh
install -D -m 0644 "${SCRIPT_DIR}/manus-dashboard-self-deploy.service" /etc/systemd/system/manus-dashboard-self-deploy.service
install -D -m 0644 "${SCRIPT_DIR}/manus-dashboard-self-deploy.path" /etc/systemd/system/manus-dashboard-self-deploy.path
systemctl daemon-reload
systemctl enable --now manus-apps-health.timer
systemctl enable --now manus-dashboard-self-deploy.path
# Un échec de contrôle doit rester visible dans systemd, sans bloquer l’installation du timer.
systemctl start manus-apps-health.service || true
systemctl status manus-apps-health.service --no-pager || true

View File

@@ -0,0 +1,9 @@
[Unit]
Description=Surveille les demandes de redéploiement du Manus Dashboard recette
[Path]
PathExists=/opt/manus-deploy/apps/manus-dashboard/.deployment-request
Unit=manus-dashboard-self-deploy.service
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,13 @@
[Unit]
Description=Redéploiement hôte du Manus Dashboard recette
After=docker.service network-online.target
Requires=docker.service
[Service]
Type=oneshot
ExecStart=/opt/manus-deploy/scripts/deploy-dashboard-from-host.sh
Restart=on-failure
RestartSec=1min
TimeoutStartSec=10min
StandardOutput=journal
StandardError=journal