The Real Fullstack

The Failed CI/CD Pipeline

The pipeline was green. The release was broken. Which order of steps made that possible?

Engenheiro8 minSimulador de linha do tempoDesafio de código
github-actionsdockerkubernetestrivy

Este desafio ainda não foi traduzido para Português (Brasil). Você está lendo a versão em inglês.

Missão:Order the pipeline so every step verifies what the next one relies on, and production receives exactly the artifact that was tested and approved.Contexto · Objetivos de aprendizagem ▾

Larkspur's pipeline grew organically: someone moved the production deploy earlier “to ship faster”, image scanning runs after the push, and end-to-end tests run against staging after production is already updated.

Missão: Order the pipeline so every step verifies what the next one relies on, and production receives exactly the artifact that was tested and approved.

Objetivos de aprendizagem

  • Order CI/CD stages by what they verify.
  • Build once, promote the same artifact.
  • Place security scanning and approvals before publication and production.
SimulaçãoSimulado
pipeline
11. buildImage ✕ test before packaging
22. pushImage ✕ never publish unscanned images
33. deployProd ✕ production only after e2e, production needs approval
44. unitTests
55. deployStaging
66. scanImage
77. e2eTests
88. approval
99. smokeTests
Executar simulação
jobs:  build:    steps: [checkout, "mvn -B verify", "docker build -t $IMAGE:$SHA .", "trivy image --exit-code 1 $IMAGE:$SHA", "docker push $IMAGE:$SHA"]  staging:    needs: build    steps: ["kubectl set image deploy/app app=$IMAGE:$SHA", "npm run e2e"]  production:    needs: staging    environment: production          # required reviewers = approval gate    steps: ["kubectl set image deploy/app app=$IMAGE:$SHA", "./smoke-tests.sh"]   # same digest, never rebuilt

Simplificação

Each constraint is a simple precedence. Real pipelines parallelise independent steps. Modelo educacional — os números ilustram comportamento, não são benchmarks.

Conceitos

Desafios relacionados

Referências