diff --git a/deploy/federated/update.sh b/deploy/federated/update.sh index 0774251..271c627 100755 --- a/deploy/federated/update.sh +++ b/deploy/federated/update.sh @@ -79,6 +79,19 @@ grep -q "container_name: superbrain-app" "$APP_DIR/docker-compose.yml" \ # --- 4. House upgrade flow ---------------------------------------------------------- WANT_VERSION=$(sed -n 's/^VERSION=//p' /federated/services/superbrain/service | tr -d '"' | head -1) + +# Source-mode migration: interim installs (2026-10-25..29) carry +# IMAGE_VERSION=local plus IMAGE_VERSION_HOLD=1, which makes upgrade_app +# skip the app entirely — and the re-rendered compose would try to pull a +# nonexistent :local tag. Convert .env to the registry version the service +# file wants before upgrading. +if grep -q '^IMAGE_VERSION_HOLD=' "$APP_DIR/.env"; then + say "Migrating .env from source-build mode to registry mode ($WANT_VERSION)" + sed -i '/^IMAGE_VERSION_HOLD=/d' "$APP_DIR/.env" + sed -i "s#^IMAGE_VERSION=.*#IMAGE_VERSION=\"$WANT_VERSION\"#" "$APP_DIR/.env" +fi +grep -q '^IMAGE_VERSION=' "$APP_DIR/.env" || echo "IMAGE_VERSION=\"$WANT_VERSION\"" >> "$APP_DIR/.env" + HAVE_VERSION=$(sed -n 's/^IMAGE_VERSION=//p' "$APP_DIR/.env" | tr -d '"' | tail -1) say "Running the house upgrade flow (have $HAVE_VERSION, service file wants $WANT_VERSION)" /federated/bin/upgrade superbrain || die "upgrade failed — inspect the output above"