diff --git a/scripts/deploy-t480.sh b/scripts/deploy-t480.sh index 1201c08..258badd 100755 --- a/scripts/deploy-t480.sh +++ b/scripts/deploy-t480.sh @@ -111,6 +111,15 @@ fi log "docker compose up -d" run ssh "$HOST" "cd $REMOTE_DIR && docker compose -f $COMPOSE_FILE up -d" +# In --skip-build mode the image and compose config are unchanged, so +# `compose up -d` is a no-op and the container keeps running the OLD uvicorn +# process. The backend is volume-mounted, so its code on disk is already the +# new version — but Python won't reload it without a restart. Force one. +if [[ "$SKIP_BUILD" == "1" ]]; then + log "docker compose restart agenteval (reload volume-mounted backend code)" + run ssh "$HOST" "cd $REMOTE_DIR && docker compose -f $COMPOSE_FILE restart agenteval" +fi + # ── verify ───────────────────────────────────────────────────────────── log "waiting for /api/health" for i in $(seq 1 30); do @@ -129,7 +138,14 @@ if [[ "$REMOTE_VERSION" != "$VERSION" ]]; then die "version mismatch! local=$VERSION remote=$REMOTE_VERSION (stale image?)" fi if [[ "$REMOTE_COMMIT" != "$COMMIT" && "$COMMIT" != "no-git" ]]; then - die "commit mismatch! local=$COMMIT remote=$REMOTE_COMMIT (image not rebuilt?)" + if [[ "$SKIP_BUILD" == "1" ]]; then + # /api/health's commit comes from the image build-arg, which --skip-build + # doesn't update. The volume-mounted code was rsync'd + the container was + # restarted, so the code IS current — only the metadata label lags. + warn "commit label still $REMOTE_COMMIT (--skip-build: image not rebuilt; code rsync'd + restarted)" + else + die "commit mismatch! local=$COMMIT remote=$REMOTE_COMMIT (image not rebuilt?)" + fi fi log "deploy OK: version=$VERSION commit=$COMMIT"