fix val
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m0s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 14s
Build, Push and Deploy / deploy-staging (push) Successful in 36s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m0s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 14s
Build, Push and Deploy / deploy-staging (push) Successful in 36s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
This commit is contained in:
@@ -98,7 +98,7 @@ jobs:
|
|||||||
|
|
||||||
# Check if container is running
|
# Check if container is running
|
||||||
sleep 5
|
sleep 5
|
||||||
if docker ps | grep -q kulakpos_web_staging; then
|
if docker ps | grep kulakpos_web_staging; then
|
||||||
echo "✅ Staging deployment successful!"
|
echo "✅ Staging deployment successful!"
|
||||||
docker logs --tail 20 kulakpos_web_staging
|
docker logs --tail 20 kulakpos_web_staging
|
||||||
else
|
else
|
||||||
@@ -223,7 +223,7 @@ jobs:
|
|||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
# Check if container is running
|
# Check if container is running
|
||||||
if docker ps | grep -q kulakpos_web_prod; then
|
if docker ps | grep kulakpos_web_prod; then
|
||||||
echo "✅ Production deployment successful!"
|
echo "✅ Production deployment successful!"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Container status:"
|
echo "Container status:"
|
||||||
@@ -275,37 +275,39 @@ jobs:
|
|||||||
ssh kulakpos_prod << 'EOF'
|
ssh kulakpos_prod << 'EOF'
|
||||||
echo "🔍 Verifying production deployment..."
|
echo "🔍 Verifying production deployment..."
|
||||||
|
|
||||||
# Check container health
|
# Check container status (fixed - removed -q flag)
|
||||||
if docker ps --filter "name=kulakpos_web_prod" --format "{{.Status}}" | grep -q "Up"; then
|
if docker ps --filter "name=kulakpos_web_prod" --format "{{.Status}}" | grep "Up" > /dev/null 2>&1; then
|
||||||
echo "✅ Container is running"
|
echo "✅ Container is running"
|
||||||
else
|
else
|
||||||
echo "❌ Container is not running"
|
echo "❌ Container is not running"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if port 8000 is listening
|
# Check if port 8000 is listening (with timeout)
|
||||||
if ss -tlnp | grep -q ":8000"; then
|
if timeout 5 ss -tlnp 2>/dev/null | grep ":8000" 2>/dev/null || netstat -tlnp 2>/dev/null | grep ":8000" 2>/dev/null; then
|
||||||
echo "✅ Application is listening on port 8000"
|
echo "✅ Application is listening on port 8000"
|
||||||
else
|
else
|
||||||
echo "❌ Application is not listening on port 8000"
|
echo "⚠️ Port 8000 not listening, checking container process..."
|
||||||
|
docker exec kulakpos_web_prod ps aux | grep php || echo "No PHP process found"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Test application response
|
# Test application response (with timeout and retry)
|
||||||
HTTP_CODE=$(curl -k -s -o /dev/null -w "%{http_code}" http://localhost:8000)
|
echo "Testing application response..."
|
||||||
if [ "$HTTP_CODE" = "200" ] || [ "$HTTP_CODE" = "302" ]; then
|
for i in 1 2 3 4 5; do
|
||||||
echo "✅ Application is responding with HTTP $HTTP_CODE"
|
if curl -f -s -o /dev/null -w "%{http_code}" http://localhost:8000 | grep "200\|302"; then
|
||||||
else
|
echo "✅ Application is responding"
|
||||||
echo "❌ Application returned HTTP $HTTP_CODE"
|
break
|
||||||
exit 1
|
elif [ $i -eq 5 ]; then
|
||||||
fi
|
echo "❌ Application not responding after 5 attempts"
|
||||||
|
docker logs --tail 20 kulakpos_web_prod
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Attempt $i/5 failed, waiting..."
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
|
||||||
# Check if .env is properly mounted
|
|
||||||
docker exec kulakpos_web_prod test -f /var/www/html/.env && echo "✅ .env file is mounted" || echo "⚠️ .env file not found"
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo "🎉 Production deployment verification complete!"
|
echo "🎉 Production deployment verification complete!"
|
||||||
echo "Application is running at: https://prod-test.kulakpos.id"
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Send Deployment Notification
|
- name: Send Deployment Notification
|
||||||
|
|||||||
Reference in New Issue
Block a user