docfast/scripts/verify-deploy.sh
DocFast Bot 73fba68320
All checks were successful
Deploy to Production / Deploy to Server (push) Successful in 1m35s
ops: add post-deploy verification script and add to CI/CD workflow
- scripts/verify-deploy.sh: checks container health, /health endpoint, and Stripe checkout
- .forgejo/workflows/deploy.yml: runs verify-deploy.sh after successful deploy
2026-02-17 11:51:36 +00:00

39 lines
1.1 KiB
Bash
Executable file

#!/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!"