Video in progress

Explain CI and CD in plain words.

CI means automatically building the code and running the tests on every push. CD means automatically delivering that verified result to environments: in continuous delivery, releasing to prod is one button, and in continuous deployment nobody touches anything.

📖 Answer

The question CI (Continuous Integration) answers is: "did my code break when it was merged with everyone else's?" For every PR the server runs mvn verify itself, and if the tests are red, the PR is not merged. The result is that a problem is found the same day, not a month later.

CD has two meanings, and interviewers ask about exactly this difference:

  • Continuous Delivery: every green build is an artifact (an image) that is ready to go to prod. A person approves the release.
  • Continuous Deployment: there is no approval, and whatever passes the tests goes to prod automatically.

A simple pipeline looks roughly like this:

push -> build -> unit test -> integration test -> docker image -> registry -> staging deploy -> (approval) -> prod

There are many tools: GitHub Actions, GitLab CI, Jenkins. The idea is the same in all of them.