From 55fb081e944b15ce9de76c5cc06f37ffe1e4b8a6 Mon Sep 17 00:00:00 2001 From: Antigravity Date: Thu, 21 May 2026 18:54:09 +0000 Subject: [PATCH] fix(deploy): use container IP dynamically for build-info health check in CI runner --- scripts/deploy-prod.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/deploy-prod.sh b/scripts/deploy-prod.sh index af6e362..c228970 100755 --- a/scripts/deploy-prod.sh +++ b/scripts/deploy-prod.sh @@ -75,8 +75,16 @@ fi nginx -t 2>/dev/null && systemctl reload nginx 2>/dev/null || true +CONTAINER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' memento-note 2>/dev/null || true) + for i in $(seq 1 24); do - BODY=$(curl -sf --max-time 3 http://127.0.0.1:3000/api/build-info 2>/dev/null || true) + BODY="" + if [ -n "$CONTAINER_IP" ]; then + BODY=$(curl -sf --max-time 3 "http://${CONTAINER_IP}:3000/api/build-info" 2>/dev/null || true) + fi + if [ -z "$BODY" ]; then + BODY=$(curl -sf --max-time 3 http://127.0.0.1:3000/api/build-info 2>/dev/null || true) + fi ACTUAL=$(echo "$BODY" | jq -r '.commit // empty' 2>/dev/null || true) if [ "$ACTUAL" = "$GIT_COMMIT" ]; then echo "OK build-info commit=$ACTUAL"