3 Commits

Author SHA1 Message Date
730cbac7ae fixed time import
Some checks failed
Release - Northern Thailand Ping River Monitor / Create Release (push) Successful in 5s
Release - Northern Thailand Ping River Monitor / Test Release Build (3.10) (push) Successful in 17s
Release - Northern Thailand Ping River Monitor / Test Release Build (3.11) (push) Successful in 14s
Release - Northern Thailand Ping River Monitor / Test Release Build (3.12) (push) Successful in 16s
Release - Northern Thailand Ping River Monitor / Test Release Build (3.9) (push) Successful in 14s
Release - Northern Thailand Ping River Monitor / Build Release Images (push) Successful in 33m48s
Release - Northern Thailand Ping River Monitor / Security Scan (push) Successful in 5s
Release - Northern Thailand Ping River Monitor / Test Release Deployment (push) Successful in 52s
Release - Northern Thailand Ping River Monitor / Notify Release (push) Successful in 2s
CI/CD Pipeline - Northern Thailand Ping River Monitor / Test Suite (3.10) (push) Failing after 45s
CI/CD Pipeline - Northern Thailand Ping River Monitor / Test Suite (3.11) (push) Failing after 26s
CI/CD Pipeline - Northern Thailand Ping River Monitor / Test Suite (3.12) (push) Failing after 1m32s
CI/CD Pipeline - Northern Thailand Ping River Monitor / Build Docker Image (push) Has been skipped
CI/CD Pipeline - Northern Thailand Ping River Monitor / Test Suite (3.9) (push) Failing after 29s
CI/CD Pipeline - Northern Thailand Ping River Monitor / Integration Test with Services (push) Has been skipped
CI/CD Pipeline - Northern Thailand Ping River Monitor / Code Quality (push) Successful in 12s
CI/CD Pipeline - Northern Thailand Ping River Monitor / Deploy to Staging (push) Has been skipped
CI/CD Pipeline - Northern Thailand Ping River Monitor / Deploy to Production (push) Has been skipped
CI/CD Pipeline - Northern Thailand Ping River Monitor / Cleanup (push) Successful in 1s
CI/CD Pipeline - Northern Thailand Ping River Monitor / Performance Test (push) Has been skipped
Security & Dependency Updates / Dependency Security Scan (push) Successful in 43s
Security & Dependency Updates / License Compliance (push) Successful in 15s
Security & Dependency Updates / Check for Dependency Updates (push) Successful in 1m31s
Security & Dependency Updates / Code Quality Metrics (push) Successful in 35s
Security & Dependency Updates / Security Summary (push) Successful in 7s
2025-08-14 10:49:31 +07:00
9c36be162f remove fallback
Some checks failed
Release - Northern Thailand Ping River Monitor / Create Release (push) Successful in 7s
Release - Northern Thailand Ping River Monitor / Test Release Build (3.10) (push) Successful in 13s
Release - Northern Thailand Ping River Monitor / Test Release Build (3.11) (push) Successful in 12s
Release - Northern Thailand Ping River Monitor / Test Release Build (3.12) (push) Successful in 13s
Release - Northern Thailand Ping River Monitor / Test Release Build (3.9) (push) Successful in 13s
Release - Northern Thailand Ping River Monitor / Build Release Images (push) Successful in 4m27s
Release - Northern Thailand Ping River Monitor / Security Scan (push) Successful in 5s
Release - Northern Thailand Ping River Monitor / Test Release Deployment (push) Successful in 1m45s
Release - Northern Thailand Ping River Monitor / Notify Release (push) Successful in 2s
CI/CD Pipeline - Northern Thailand Ping River Monitor / Test Suite (3.10) (push) Failing after 14s
CI/CD Pipeline - Northern Thailand Ping River Monitor / Test Suite (3.11) (push) Failing after 15s
CI/CD Pipeline - Northern Thailand Ping River Monitor / Test Suite (3.12) (push) Failing after 12s
CI/CD Pipeline - Northern Thailand Ping River Monitor / Test Suite (3.9) (push) Failing after 10s
CI/CD Pipeline - Northern Thailand Ping River Monitor / Build Docker Image (push) Has been skipped
CI/CD Pipeline - Northern Thailand Ping River Monitor / Integration Test with Services (push) Has been skipped
CI/CD Pipeline - Northern Thailand Ping River Monitor / Code Quality (push) Successful in 11s
Security & Dependency Updates / Check for Dependency Updates (push) Successful in 43s
CI/CD Pipeline - Northern Thailand Ping River Monitor / Deploy to Staging (push) Has been skipped
CI/CD Pipeline - Northern Thailand Ping River Monitor / Deploy to Production (push) Has been skipped
CI/CD Pipeline - Northern Thailand Ping River Monitor / Cleanup (push) Successful in 2s
CI/CD Pipeline - Northern Thailand Ping River Monitor / Performance Test (push) Has been skipped
Security & Dependency Updates / Dependency Security Scan (push) Successful in 39s
Security & Dependency Updates / License Compliance (push) Successful in 20s
Security & Dependency Updates / Code Quality Metrics (push) Successful in 1m8s
Security & Dependency Updates / Security Summary (push) Successful in 23s
2025-08-13 19:51:42 +07:00
c3498bda76 test
Some checks failed
Release - Northern Thailand Ping River Monitor / Create Release (push) Successful in 5s
Security & Dependency Updates / Dependency Security Scan (push) Successful in 22s
Security & Dependency Updates / License Compliance (push) Successful in 10s
Security & Dependency Updates / Check for Dependency Updates (push) Successful in 17s
Security & Dependency Updates / Code Quality Metrics (push) Successful in 13s
Release - Northern Thailand Ping River Monitor / Test Release Build (3.10) (push) Successful in 13s
Release - Northern Thailand Ping River Monitor / Test Release Build (3.9) (push) Successful in 15s
Security & Dependency Updates / Security Summary (push) Successful in 6s
Release - Northern Thailand Ping River Monitor / Test Release Build (3.11) (push) Successful in 13s
Release - Northern Thailand Ping River Monitor / Test Release Build (3.12) (push) Successful in 15s
Release - Northern Thailand Ping River Monitor / Build Release Images (push) Successful in 6m34s
Release - Northern Thailand Ping River Monitor / Security Scan (push) Successful in 3s
Release - Northern Thailand Ping River Monitor / Test Release Deployment (push) Failing after 57s
Release - Northern Thailand Ping River Monitor / Notify Release (push) Successful in 1s
2025-08-13 17:16:49 +07:00
2 changed files with 11 additions and 21 deletions

View File

@@ -187,16 +187,16 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
echo "🚀 Testing ${{ needs.create-release.outputs.version }} deployment locally..." echo "🚀 Testing ${{ needs.create-release.outputs.version }} deployment locally..."
# Create a dedicated network so we can resolve by container name # Create a dedicated network so we can resolve by container name
docker network create ci_net || true docker network create ci_net || true
# Pull the built image # Pull the built image
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.create-release.outputs.version }} docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.create-release.outputs.version }}
# Stop & remove any existing container # Stop & remove any existing container
docker rm -f ping-river-monitor-test 2>/dev/null || true docker rm -f ping-river-monitor-test 2>/dev/null || true
# Start the container on the user-defined network # Start the container on the user-defined network
docker run -d \ docker run -d \
--name ping-river-monitor-test \ --name ping-river-monitor-test \
@@ -205,24 +205,24 @@ jobs:
-e LOG_LEVEL=INFO \ -e LOG_LEVEL=INFO \
-e DB_TYPE=sqlite \ -e DB_TYPE=sqlite \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.create-release.outputs.version }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.create-release.outputs.version }}
echo "✅ Container started for testing" echo "✅ Container started for testing"
- name: Health check after deployment - name: Health check after deployment
run: | run: |
set -euo pipefail set -euo pipefail
echo "⏳ Waiting for application to start..." echo "⏳ Waiting for application to start..."
# Pull a curl-only image for probing (keeps your app image slim) # Pull a curl-only image for probing (keeps your app image slim)
docker pull curlimages/curl:8.10.1 docker pull curlimages/curl:8.10.1
# Helper: curl via a sibling container on the SAME Docker network # Helper: curl via a sibling container on the SAME Docker network
probe() { probe() {
local url="$1" local url="$1"
docker run --rm --network ci_net curlimages/curl:8.10.1 \ docker run --rm --network ci_net curlimages/curl:8.10.1 \
-sS --max-time 5 --connect-timeout 3 -w "HTTP_CODE:%{http_code}" "$url" || true -sS --max-time 5 --connect-timeout 3 -w "HTTP_CODE:%{http_code}" "$url" || true
} }
# Wait for /health (up to ~3m 45s) # Wait for /health (up to ~3m 45s)
for i in {1..15}; do for i in {1..15}; do
echo "🔍 Attempt $i/15: checking http://ping-river-monitor-test:8000/health" echo "🔍 Attempt $i/15: checking http://ping-river-monitor-test:8000/health"
@@ -246,7 +246,7 @@ jobs:
exit 1 exit 1
fi fi
done done
echo "🧪 Testing API endpoints…" echo "🧪 Testing API endpoints…"
endpoints=("health" "docs" "stations" "metrics") endpoints=("health" "docs" "stations" "metrics")
for ep in "${endpoints[@]}"; do for ep in "${endpoints[@]}"; do
@@ -262,19 +262,8 @@ jobs:
exit 1 exit 1
fi fi
done done
echo "✅ All health checks passed!"
- name: (Fallback) Probe via host-published port echo "✅ All health checks passed!"
if: always()
run: |
set -euo pipefail
# In case you also want to verify the host-published port from inside the job container:
HOST_GATEWAY="$(ip route | awk '/default/ {print $3}')"
echo "🔎 Host gateway is $HOST_GATEWAY — probing http://$HOST_GATEWAY:8080/health"
docker run --rm curlimages/curl:8.10.1 \
-sS --max-time 5 --connect-timeout 3 -w "HTTP_CODE:%{http_code}\n" \
"http://$HOST_GATEWAY:8080/health" || true
- name: Container logs and cleanup - name: Container logs and cleanup
if: always() if: always()

View File

@@ -7,6 +7,7 @@ import argparse
import asyncio import asyncio
import sys import sys
import signal import signal
import time
from datetime import datetime from datetime import datetime
from typing import Optional from typing import Optional