ops: add post-deploy verification script and add to CI/CD workflow
All checks were successful
Deploy to Production / Deploy to Server (push) Successful in 1m35s
All checks were successful
Deploy to Production / Deploy to Server (push) Successful in 1m35s
- scripts/verify-deploy.sh: checks container health, /health endpoint, and Stripe checkout - .forgejo/workflows/deploy.yml: runs verify-deploy.sh after successful deploy
This commit is contained in:
parent
f5cea97adf
commit
73fba68320
2 changed files with 43 additions and 0 deletions
39
scripts/verify-deploy.sh
Executable file
39
scripts/verify-deploy.sh
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
# Post-deploy verification for DocFast
|
||||
set -e
|
||||
|
||||
echo "⏳ Waiting for container to be healthy..."
|
||||
for i in $(seq 1 30); do
|
||||
STATUS=$(docker inspect --format='{{.State.Health.Status}}' docfast-docfast-1 2>/dev/null || echo "not found")
|
||||
if [ "$STATUS" = "healthy" ]; then
|
||||
echo "✅ Container healthy"
|
||||
break
|
||||
fi
|
||||
if [ $i -eq 30 ]; then
|
||||
echo "❌ Container not healthy after 30s"
|
||||
exit 1
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "🔍 Checking health endpoint..."
|
||||
HEALTH=$(curl -sf http://localhost:3100/health | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['status'])" 2>/dev/null)
|
||||
if [ "$HEALTH" != "ok" ]; then
|
||||
echo "❌ Health check failed"
|
||||
exit 1
|
||||
fi
|
||||
echo "✅ Health OK"
|
||||
|
||||
echo "🔍 Checking Stripe checkout..."
|
||||
CHECKOUT=$(curl -sf -X POST http://localhost:3100/v1/billing/checkout -H "Content-Type: application/json" 2>&1)
|
||||
if echo "$CHECKOUT" | grep -q '"url"'; then
|
||||
echo "✅ Stripe checkout working"
|
||||
elif echo "$CHECKOUT" | grep -q 'STRIPE_SECRET_KEY'; then
|
||||
echo "❌ STRIPE_SECRET_KEY not configured!"
|
||||
exit 1
|
||||
else
|
||||
echo "⚠️ Checkout returned: $CHECKOUT"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "🎉 Deploy verification passed!"
|
||||
Loading…
Add table
Add a link
Reference in a new issue