fix vald
All checks were successful
All checks were successful
This commit is contained in:
@@ -231,11 +231,6 @@ jobs:
|
||||
echo ""
|
||||
echo "Container logs (last 20 lines):"
|
||||
docker logs --tail 20 kulakpos_web_prod
|
||||
|
||||
# Test the application locally
|
||||
echo ""
|
||||
echo "Testing application locally..."
|
||||
curl -f http://127.0.0.1:8000 > /dev/null 2>&1 && echo "✅ Application is responding on port 8000" || echo "⚠️ Application not responding on port 8000"
|
||||
else
|
||||
echo "❌ Production deployment failed! Checking logs:"
|
||||
docker logs kulakpos_web_prod || echo "No logs available"
|
||||
@@ -269,67 +264,3 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
EOF
|
||||
|
||||
- name: Verify Production Deployment
|
||||
run: |
|
||||
ssh kulakpos_prod << 'EOF'
|
||||
echo "🔍 Verifying production deployment..."
|
||||
|
||||
# Check container status (fixed - removed -q flag)
|
||||
if docker ps --filter "name=kulakpos_web_prod" --format "{{.Status}}" | grep "Up" > /dev/null 2>&1; then
|
||||
echo "✅ Container is running"
|
||||
else
|
||||
echo "❌ Container is not running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if port 8000 is listening (with timeout)
|
||||
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"
|
||||
else
|
||||
echo "⚠️ Port 8000 not listening, checking container process..."
|
||||
docker exec kulakpos_web_prod ps aux | grep php || echo "No PHP process found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test application response (with timeout and retry)
|
||||
echo "Testing application response..."
|
||||
for i in 1 2 3 4 5; do
|
||||
if curl -f -s -o /dev/null -w "%{http_code}" http://127.0.0.1:8000 | grep "200\|302"; then
|
||||
echo "✅ Application is responding"
|
||||
break
|
||||
elif [ $i -eq 5 ]; then
|
||||
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
|
||||
|
||||
echo "🎉 Production deployment verification complete!"
|
||||
EOF
|
||||
|
||||
- name: Send Deployment Notification
|
||||
if: always()
|
||||
run: |
|
||||
STATUS="${{ job.status }}"
|
||||
if [ "$STATUS" = "success" ]; then
|
||||
echo "✅ Production deployment completed successfully!"
|
||||
echo "🌐 Application is now running at: https://prod-test.kulakpos.id"
|
||||
echo "🐳 Container name: kulakpos_web_prod"
|
||||
echo "🔌 Port: 8000 (internal) -> 80/443 (Nginx proxy)"
|
||||
else
|
||||
echo "❌ Production deployment failed!"
|
||||
echo "Please check the logs above for details"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cleanup:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [deploy-staging, deploy-production]
|
||||
if: always()
|
||||
steps:
|
||||
- name: Cleanup old Docker images on runners
|
||||
run: |
|
||||
docker system prune -f --filter "until=24h"
|
||||
Reference in New Issue
Block a user