fix(ci): allow 401 response status in deploy healthcheck verification
This commit is contained in:
@@ -295,8 +295,8 @@ jobs:
|
|||||||
echo " Health check attempt $i..."
|
echo " Health check attempt $i..."
|
||||||
loopback_headers=$(ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 "$DEPLOY_USER@$DEPLOY_SSH_HOST" "curl -s -D - -o /dev/null -m 5 http://127.0.0.1:5000/" 2>&1)
|
loopback_headers=$(ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i ~/.ssh/id_ed25519 "$DEPLOY_USER@$DEPLOY_SSH_HOST" "curl -s -D - -o /dev/null -m 5 http://127.0.0.1:5000/" 2>&1)
|
||||||
|
|
||||||
if printf '%s' "$loopback_headers" | grep -qE '^HTTP/1\.[01] (200|30[12]) '; then
|
if printf '%s' "$loopback_headers" | grep -qE '^HTTP/1\.[01] (200|30[12]|401) '; then
|
||||||
echo "✓ Loopback health check passed"
|
echo "✓ Loopback health check passed (auth required)"
|
||||||
break
|
break
|
||||||
elif [ $i -lt 3 ]; then
|
elif [ $i -lt 3 ]; then
|
||||||
echo " Waiting 5s for service..."
|
echo " Waiting 5s for service..."
|
||||||
@@ -334,8 +334,8 @@ jobs:
|
|||||||
echo "https://quant.taxbaik.com/ -> ${public_root_code}"
|
echo "https://quant.taxbaik.com/ -> ${public_root_code}"
|
||||||
echo "https://quant.taxbaik.com/login -> ${login_code}"
|
echo "https://quant.taxbaik.com/login -> ${login_code}"
|
||||||
|
|
||||||
if [ "$public_root_code" != "302" ] && [ "$public_root_code" != "200" ]; then
|
if [ "$public_root_code" != "302" ] && [ "$public_root_code" != "200" ] && [ "$public_root_code" != "401" ]; then
|
||||||
echo "Deployment content check failed for public root" >&2
|
echo "Deployment content check failed for public root (received $public_root_code)" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ "$login_code" != "200" ]; then
|
if [ "$login_code" != "200" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user