From 3b717076608da85370cb76aeb52f4eaa1fcb8fa7 Mon Sep 17 00:00:00 2001 From: Oskar Kapala Date: Fri, 26 Jun 2026 15:16:42 +0200 Subject: [PATCH] =?UTF-8?q?fix(deploy):=20exclude=20control-plane=20from?= =?UTF-8?q?=20node=20deploy=20loop=20=E2=80=94=20prevents=20brain=20teardo?= =?UTF-8?q?wn=20via=20project-name=20divergence?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit deploy.sh vps iterates hosts/vps/services.yaml in deploy-node.sh, which includes control-plane. But control-plane also has a dedicated deploy path (deploy.sh control-plane → deploy-control-plane.sh → deploy-local.sh) that runs compose from services/control-plane/. The node loop runs compose from ${REPO_PATH}, so on Compose versions that derive the project name from cwd the two paths own the containers under different project names. The loop's `up -d --remove-orphans` then Recreates and tears down the running brain (observer/supervisor/executor/ui), aborting the loop under set -e. This wiped the VPS control-plane on 2026-06-25. Generic guard: skip any service that ships its own services//deploy-local.sh. control-plane stays in services.yaml so the gate (pytest+build) still covers it; only the destructive loop deploy is skipped. Protects future services with a dedicated deploy path too. Co-Authored-By: Claude Opus 4.8 --- scripts/deploy/deploy-node.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/deploy/deploy-node.sh b/scripts/deploy/deploy-node.sh index 1b6849c..69df10c 100755 --- a/scripts/deploy/deploy-node.sh +++ b/scripts/deploy/deploy-node.sh @@ -82,6 +82,19 @@ fi # 3. Deploy Services for service in "${SERVICES[@]}"; do + # Services that ship their own deploy-local.sh have a dedicated, orchestrated + # deploy path (e.g. control-plane via deploy-control-plane.sh → deploy-local.sh). + # Deploying them in this loop too would invoke `docker compose up` with a + # different Compose project name than their dedicated path uses (this loop runs + # from ${REPO_PATH}; deploy-local.sh runs from services//), so `up + # -d --remove-orphans` would Recreate and tear down the already-running + # containers — exactly what wiped the control-plane on VPS on 2026-06-25. + # Their own deploy path owns them; skip here. + if [ -f "${REPO_PATH}/services/${service}/deploy-local.sh" ]; then + echo "Skipping ${service}: ma własną ścieżkę deployu (services/${service}/deploy-local.sh), pomijam" + continue + fi + echo "Deploying service: ${service}..." COMPOSE_FILE="${REPO_PATH}/services/${service}/docker-compose.yml"