fix(deploy): exclude control-plane from node deploy loop — prevents brain teardown via project-name divergence

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/<svc>/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 <noreply@anthropic.com>
This commit is contained in:
Oskar Kapala 2026-06-26 15:16:42 +02:00
parent c0ffb6abf7
commit 3b71707660

View file

@ -82,6 +82,19 @@ fi
# 3. Deploy Services # 3. Deploy Services
for service in "${SERVICES[@]}"; do 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/<svc>/), 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}..." echo "Deploying service: ${service}..."
COMPOSE_FILE="${REPO_PATH}/services/${service}/docker-compose.yml" COMPOSE_FILE="${REPO_PATH}/services/${service}/docker-compose.yml"