deploy atualizado; test correto
DevSecOps Enterprise Pipeline / security-gate-and-deploy (pull_request) Failing after 8s
DevSecOps Enterprise Pipeline / security-gate-and-deploy (pull_request) Failing after 8s
This commit is contained in:
@@ -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
|
||||||
@@ -91,7 +97,7 @@ jobs:
|
|||||||
|
|
||||||
echo ">>> Publicando Relatório ZAP no servidor Web..."
|
echo ">>> Publicando Relatório ZAP no servidor Web..."
|
||||||
docker cp qatests/report.html portal-corporativo:/usr/src/app/frontend/zap-report.html || true
|
docker cp qatests/report.html portal-corporativo:/usr/src/app/frontend/zap-report.html || true
|
||||||
|
|
||||||
- name: 7. Archive ZAP Report (Gitea Artifacts)
|
- name: 7. Archive ZAP Report (Gitea Artifacts)
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
|
|||||||
+1
-1
@@ -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); });
|
||||||
|
|||||||
Reference in New Issue
Block a user