deploy atualizado; test correto
DevSecOps Enterprise Pipeline / security-gate-and-deploy (pull_request) Failing after 8s

This commit is contained in:
pm
2026-06-11 23:54:58 +01:00
parent b71d73afe0
commit c234771d28
2 changed files with 11 additions and 5 deletions
+9 -3
View File
@@ -17,6 +17,12 @@ jobs:
- name: 1. Build Application Image - name: 1. Build Application Image
run: docker build -f backend/Dockerfile -t apex-solutions:latest . run: docker build -f backend/Dockerfile -t apex-solutions:latest .
- name: 1.5. Run Unit Tests (Lógica de Negócio)
run: |
echo ">>> A instalar dependências e correr testes..."
npm ci
npm test
# ========================================== # ==========================================
# ETAPAS ESTÁTICAS DE SEGURANÇA SEPARADAS # ETAPAS ESTÁTICAS DE SEGURANÇA SEPARADAS
# ========================================== # ==========================================
@@ -24,12 +30,12 @@ jobs:
- name: 2. Secret Scanning (Gitleaks) - name: 2. Secret Scanning (Gitleaks)
run: | run: |
curl -sL https://github.com/gitleaks/gitleaks/releases/download/v8.18.2/gitleaks_8.18.2_linux_x64.tar.gz | tar -xz -C /tmp curl -sL https://github.com/gitleaks/gitleaks/releases/download/v8.18.2/gitleaks_8.18.2_linux_x64.tar.gz | tar -xz -C /tmp
/tmp/gitleaks detect --source . --verbose --redact --exit-code 1 || echo "[ALERTA] Credenciais detetadas! Ignorado temporariamente." /tmp/gitleaks detect --source . --verbose --redact --exit-code 1
- name: 3. Software Composition Analysis (Trivy) - name: 3. Software Composition Analysis (Trivy)
run: | run: |
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
trivy image --severity HIGH,CRITICAL apex-solutions:latest || echo "[ALERTA] Vulnerabilidades de infraestrutura encontradas!" trivy image --severity HIGH,CRITICAL apex-solutions:latest
- name: 4. Static Application Security Testing (SonarQube) - name: 4. Static Application Security Testing (SonarQube)
run: | run: |
@@ -40,7 +46,7 @@ jobs:
-Dsonar.sources=. \ -Dsonar.sources=. \
-Dsonar.host.url=https://sonar.each-cs.com \ -Dsonar.host.url=https://sonar.each-cs.com \
-Dsonar.token=${{ secrets.SONAR_TOKEN }} \ -Dsonar.token=${{ secrets.SONAR_TOKEN }} \
-Dsonar.qualitygate.wait=true || echo "[ALERTA] SonarQube falhou no Quality Gate." -Dsonar.qualitygate.wait=true
# ========================================== # ==========================================
# ETAPAS DINÂMICAS E DEPLOY # ETAPAS DINÂMICAS E DEPLOY
+1 -1
View File
@@ -1 +1 @@
test('Pipeline flow: 1 + 1 deve ser 2', () => { expect(1 + 1).toBe(); }); test('Pipeline flow: 1 + 1 deve ser 2', () => { expect(1 + 1).toBe(2); });