update.sh: migrate source-mode installs to registry mode
release gate / check (push) Failing after 6m19s

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.
This commit is contained in:
Andrew S Erwin
2026-10-29 10:25:16 -05:00
parent 341cdce026
commit d914a87e98
+13
View File
@@ -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"