为 ssh heredoc 中的循环与变量引用补充转义,避免在本地 set -u 环境下提前展开导致 HEALTH_URL/HEALTH_OK 未定义报错。 Made-with: Cursor
This commit is contained in:
@@ -71,16 +71,16 @@ jobs:
|
||||
docker compose -f deploy/docker/docker-compose.yml ps
|
||||
HEALTH_URL="http://127.0.0.1:\${HOST_BIND_PORT:-3000}/api/docs"
|
||||
HEALTH_OK=0
|
||||
for i in $(seq 1 30); do
|
||||
if curl -fsS "${HEALTH_URL}" >/dev/null; then
|
||||
for i in \$(seq 1 30); do
|
||||
if curl -fsS "\${HEALTH_URL}" >/dev/null; then
|
||||
HEALTH_OK=1
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
if [ "${HEALTH_OK}" -ne 1 ]; then
|
||||
if [ "\${HEALTH_OK}" -ne 1 ]; then
|
||||
docker compose -f deploy/docker/docker-compose.yml --env-file deploy/docker/.env logs --tail=200 app || true
|
||||
echo "Health check failed: ${HEALTH_URL}"
|
||||
echo "Health check failed: \${HEALTH_URL}"
|
||||
exit 1
|
||||
fi
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user