From d914a87e9864ffac79b19d223d94f0f1a0d15b02 Mon Sep 17 00:00:00 2001 From: Andrew S Erwin Date: Thu, 29 Oct 2026 10:25:16 -0500 Subject: [PATCH] update.sh: migrate source-mode installs to registry mode Interim installs carry IMAGE_VERSION=local + IMAGE_VERSION_HOLD=1: the hold makes upgrade_app skip the app, and the re-rendered registry compose would pull a nonexistent :local tag. update.sh now detects the hold, drops it, and pins IMAGE_VERSION to the service file's VERSION before invoking the house upgrade flow. --- deploy/federated/update.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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"