CI/CD Pipeline Monitor

หน้านี้เป็น dashboard สำหรับ monitor release flow ของ sandbox: source, build, CVE scan, SonarQube quality gate, Docker Compose, nginx, smoke test และ rollback readiness.

Overall Status

MANUAL CHECK

ใช้หน้านี้เป็น runbook ก่อนต่อ live CI API. ทุก stage ต้องมีหลักฐานคำสั่งหรือ log ก่อน deploy.

Environment

Local: http://localhost/pipeline/

Production: https://sandbox.mangoconsultant.com/pipeline/

Release Contract

Deploy ได้เมื่อ npm audit = 0, Trivy filesystem scan ผ่าน, SonarQube gate ผ่าน, Docker image scan ไม่มี high/critical ที่แก้ได้ และ smoke route ได้ 200.

Pipeline Stages

1. Source Ready
ตรวจ git status, branch, commit, และไม่ให้มี secret/runtime artifact หลุดเข้า repo.
LOCAL
2. Dependency CVE
รัน npm audit --audit-level=moderate ใน Next.js ทุก service. Gate ต้องไม่เหลือ moderate/high/critical.
REQUIRED
3. SonarQube
รัน scanner ด้วย sonar-project.properties. CI ต้อง fail ถ้า Quality Gate ไม่ผ่าน.
REQUIRED
4. Image Scan
scan final Docker image ด้วย Trivy หรือ Docker Scout ไม่ใช่แค่ base image.
MANUAL/CI
5. Compose + nginx
ตรวจ docker compose config, build image, start container และ nginx -t.
REQUIRED
6. Smoke Routes
ตรวจ /, /projects/demo1/, /projects/demo1-ms/, /handbook.html, /pipeline/.
REQUIRED
7. Rollback Ready
ต้องรู้ commit ก่อนหน้า, image ก่อนหน้า, และคำสั่ง rollback ก่อนกด deploy production.
REQUIRED

Service Health Matrix

ServiceRoute / PortExpectedOwner
reverse-proxy/, 80/443nginx running, portal servedInfra
foreman-assignment-app/projects/demo1/, 3100Next.js app opens with base path assetsFE
demo1-web/projects/demo1-ms/, 3000BFF forwards to Go/AI servicesFE/BFF
demo1-go-apiinternal 8080worker, assignment, audit APIs healthyBE
demo1-ai-apiinternal 8000AI suggestion/capture APIs healthyAI
sonarqubelocalhost:9000quality gate available under compose profileQA/DevOps

Copyable Local Gate

cd /Users/phatcharaphoninsee/Documents/reverse-proxy-project
./scripts/quality-gate.sh

cd services
docker compose -f docker-compose.local.yml --profile quality up -d sonarqube sonar-postgres

docker run --rm \
  -v "$PWD/..:/usr/src" \
  sonarsource/sonar-scanner-cli \
  -Dsonar.host.url=http://host.docker.internal:9000 \
  -Dsonar.token="$SONAR_TOKEN"

Production Smoke Test

curl -sL -o /dev/null -w '%{http_code} %{url_effective}\n' https://sandbox.mangoconsultant.com/
curl -sL -o /dev/null -w '%{http_code} %{url_effective}\n' https://sandbox.mangoconsultant.com/projects/demo1/
curl -sL -o /dev/null -w '%{http_code} %{url_effective}\n' https://sandbox.mangoconsultant.com/projects/demo1-ms/
curl -sL -o /dev/null -w '%{http_code} %{url_effective}\n' https://sandbox.mangoconsultant.com/pipeline/