fix(ci): use SSH-based container status check for smoke test
CI/CD / deploy (push) Failing after 51s Details

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-04-01 15:06:37 -07:00
parent c4ef62a144
commit c35621fcb8
1 changed files with 6 additions and 4 deletions

View File

@ -52,9 +52,12 @@ jobs:
- name: Smoke test - name: Smoke test
run: | run: |
sleep 15 sleep 15
HTTP_CODE=$(curl -sSL -o /dev/null -w "%{http_code}" --max-time 30 https://rstack.online/ 2>/dev/null || echo "000") STATUS=$(ssh -o StrictHostKeyChecking=no -i ~/.ssh/deploy_key root@${{ secrets.DEPLOY_HOST }} \
if [ "$HTTP_CODE" -lt 200 ] || [ "$HTTP_CODE" -ge 400 ]; then "cd /opt/websites/rstack-online && docker compose ps --format '{{{{.Status}}}}' 2>/dev/null | head -1 || echo 'unknown'")
echo "Smoke test failed (HTTP $HTTP_CODE) — rolling back" if echo "$STATUS" | grep -qi "up"; then
echo "Smoke test passed (container status: $STATUS)"
else
echo "Smoke test failed (container status: $STATUS) — rolling back"
ROLLBACK_TAG=$(ssh -o StrictHostKeyChecking=no -i ~/.ssh/deploy_key root@${{ secrets.DEPLOY_HOST }} "cat /opt/websites/rstack-online/.rollback-tag 2>/dev/null") ROLLBACK_TAG=$(ssh -o StrictHostKeyChecking=no -i ~/.ssh/deploy_key root@${{ secrets.DEPLOY_HOST }} "cat /opt/websites/rstack-online/.rollback-tag 2>/dev/null")
if [ -n "$ROLLBACK_TAG" ]; then if [ -n "$ROLLBACK_TAG" ]; then
ssh -o StrictHostKeyChecking=no -i ~/.ssh/deploy_key root@${{ secrets.DEPLOY_HOST }} \ ssh -o StrictHostKeyChecking=no -i ~/.ssh/deploy_key root@${{ secrets.DEPLOY_HOST }} \
@ -63,4 +66,3 @@ jobs:
fi fi
exit 1 exit 1
fi fi
echo "Smoke test passed (HTTP $HTTP_CODE)"