deploy en-us e unit tests melhorado
DevSecOps Enterprise Pipeline / security-gate-and-deploy (pull_request) Failing after 7s

This commit is contained in:
pm
2026-06-12 00:28:08 +01:00
parent 70321152a7
commit bba5d7c581
5 changed files with 637 additions and 18 deletions
+12 -12
View File
@@ -17,14 +17,14 @@ jobs:
- name: 1. Build Application Image
run: docker build -f backend/Dockerfile -t apex-solutions:latest .
- name: 1.5. Run Unit Tests (Lógica de Negócio)
- name: 1.5. Execute Unit Tests (Business Logic)
run: |
echo ">>> A instalar dependências e correr testes..."
echo ">>> Installing dependencies and executing test suite..."
npm ci
npm test
# ==========================================
# ETAPAS ESTÁTICAS DE SEGURANÇA SEPARADAS
# STATIC SECURITY ANALYSIS STAGES
# ==========================================
- name: 2. Secret Scanning (Gitleaks)
@@ -50,18 +50,18 @@ jobs:
-Dsonar.qualitygate.wait=true
# ==========================================
# ETAPAS DINÂMICAS E DEPLOY
# DYNAMIC SECURITY ANALYSIS & DEPLOYMENT
# ==========================================
- name: 5. Dynamic Security Scan (OWASP ZAP)
if: github.event_name == 'push'
run: |
echo ">>> Lançando Sandbox Efêmero..."
echo ">>> Provisioning ephemeral sandbox environment..."
docker rm -f apex-sandbox || true
docker run -d --name apex-sandbox apex-solutions:latest
sleep 5
echo ">>> Executando OWASP ZAP Baseline Scan..."
echo ">>> Initiating OWASP ZAP Baseline Scan..."
mkdir -p qatests
docker rm -f zap-scanner || true
docker volume rm zap-reports || true
@@ -77,7 +77,7 @@ jobs:
docker cp zap-scanner:/zap/wrk/report.html qatests/report.html || true
echo ">>> Destruindo Sandbox..."
echo ">>> Decommissioning ephemeral sandbox..."
docker rm -f zap-scanner || true
docker volume rm zap-reports || true
docker rm -f apex-sandbox || true
@@ -85,20 +85,20 @@ jobs:
- name: 6. Production Deployment & Local Reports
if: github.event_name == 'push'
run: |
echo ">>> Atualizando Produção..."
echo ">>> Deploying application to production environment..."
docker rm -f portal-corporativo || true
docker run -d -p 3000:3000 --name portal-corporativo apex-solutions:latest
echo ">>> Aguardando arranque do Node.js..."
echo ">>> Awaiting Node.js service initialization..."
sleep 5
echo ">>> Logs do Contentor (para despiste de erros):"
echo ">>> Container logs (for diagnostic purposes):"
docker logs portal-corporativo
echo ">>> A testar integridade do servidor (Internamente via wget)..."
echo ">>> Performing internal health check (via wget)..."
docker exec portal-corporativo wget --spider -S http://localhost:3000
echo ">>> Publicando Relatório ZAP no servidor Web..."
echo ">>> Publishing OWASP ZAP security report to web server..."
docker cp qatests/report.html portal-corporativo:/usr/src/app/frontend/zap-report.html || true
- name: 7. Archive ZAP Report (Gitea Artifacts)