Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
6141140beb | |||
c62ee5f699 | |||
cd59236473 |
@@ -3,16 +3,16 @@ name: Release - Northern Thailand Ping River Monitor
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
- "v*.*.*"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Release version (e.g., v3.1.3)'
|
||||
description: "Release version (e.g., v3.1.3)"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
env:
|
||||
PYTHON_VERSION: '3.11'
|
||||
PYTHON_VERSION: "3.11"
|
||||
REGISTRY: git.b4l.co.th
|
||||
IMAGE_NAME: b4l/northern-thailand-ping-river-monitor
|
||||
# GitHub token for better rate limits and authentication
|
||||
@@ -71,7 +71,7 @@ jobs:
|
||||
needs: create-release
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.9', '3.10', '3.11', '3.12']
|
||||
python-version: ["3.9", "3.10", "3.11", "3.12"]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -161,8 +161,6 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.GITEA_TOKEN}}
|
||||
|
||||
|
||||
|
||||
# Test release deployment locally
|
||||
deploy-release:
|
||||
name: Test Release Deployment
|
||||
@@ -213,23 +211,37 @@ jobs:
|
||||
|
||||
echo "🔍 Running health checks against local container..."
|
||||
|
||||
# Wait for the application to be ready
|
||||
for i in {1..12}; do
|
||||
if curl -f http://localhost:8080/health; then
|
||||
echo "✅ Health endpoint responding"
|
||||
# Check if container is running
|
||||
docker ps | grep ping-river-monitor-test || echo "⚠️ Container not found in docker ps"
|
||||
|
||||
# Check container logs for any startup issues
|
||||
echo "📋 Recent container logs:"
|
||||
docker logs --tail 10 ping-river-monitor-test || true
|
||||
|
||||
# Wait for the application to be ready with more robust checking
|
||||
echo "🔍 Testing application readiness..."
|
||||
for i in {1..15}; do
|
||||
echo "⏳ Attempt $i/15: Testing health endpoint..."
|
||||
|
||||
# Use curl with more verbose output and longer timeout
|
||||
if curl -f -s --max-time 10 --connect-timeout 5 http://127.0.0.1:8080/health; then
|
||||
echo "✅ Health endpoint responding successfully!"
|
||||
break
|
||||
else
|
||||
echo "⏳ Waiting for health endpoint... (attempt $i/12)"
|
||||
sleep 10
|
||||
echo "❌ Health check failed, waiting 15 seconds..."
|
||||
# Show what's happening with the container
|
||||
echo "Container status:"
|
||||
docker ps | grep ping-river-monitor-test || echo "Container not found"
|
||||
sleep 15
|
||||
fi
|
||||
done
|
||||
|
||||
# Test API endpoints
|
||||
echo "🧪 Testing API endpoints..."
|
||||
curl -f http://localhost:8080/health || exit 1
|
||||
curl -f http://localhost:8080/docs || exit 1
|
||||
curl -f http://localhost:8080/stations || exit 1
|
||||
curl -f http://localhost:8080/metrics || exit 1
|
||||
curl -f http://127.0.0.1:8080/health || exit 1
|
||||
curl -f http://127.0.0.1:8080/docs || exit 1
|
||||
curl -f http://127.0.0.1:8080/stations || exit 1
|
||||
curl -f http://127.0.0.1:8080/metrics || exit 1
|
||||
|
||||
echo "✅ All health checks passed!"
|
||||
|
||||
@@ -249,8 +261,6 @@ jobs:
|
||||
echo "Status: Container tested successfully"
|
||||
echo "Ready for production deployment"
|
||||
|
||||
|
||||
|
||||
# Notify stakeholders
|
||||
notify:
|
||||
name: Notify Release
|
||||
|
Reference in New Issue
Block a user