Repaso
Español
Cloud & DevOpsIntermediateOPS-15

Which order makes the most sense for a CI/CD pipeline?

Options

  1. Deploy to prod, then run the tests, then build the image
  2. Lint and unit tests, build, integration tests, staging, smoke tests, prod (Correct option)
  3. Build, deploy to prod, then lint the code afterwards
  4. Deploy to staging only on Fridays, then run all tests at once

Answer

Lint and unit tests → build image → integration tests → deploy staging → smoke tests → deploy prod

Why

Run the fastest, cheapest checks first so problems are found in seconds (fail fast): linting and unit tests.

Then build the artifact (Docker image) ONCE, run slower integration tests, deploy to staging and smoke-test it.

Finally promote that same image to production, so what you tested is exactly what you ship.

Remember

Cheap checks first; build once; promote the same artifact.

Key terms

Practice this question in Repaso