Medium java docker

What is the difference between continuous integration and continuous deployment?

The 30 second answer

Continuous integration means every change is merged into a shared branch frequently and automatically built and tested, so integration problems show up in minutes. Continuous delivery means that passing build is always in a releasable state. Continuous deployment goes one step further and automatically puts every passing change into production. I would not turn on continuous deployment without tests, observability and a fast rollback; many teams practise CI and continuous delivery with a manual production approve.

Could you say this in an interview?

The terms are often flattened to "the pipeline", but they are different promises.

Continuous integration (CI). Developers integrate into a shared mainline often (at least daily, in the original sense). A server builds the revision and runs the test suite. A red build is the team's first priority. CI does not by itself ship to users.

Continuous delivery (CD). CI plus the work to keep the artefact always releasable: automated acceptance tests, versioned artefacts, migrations that can roll forward. A person (or a scheduled window) still presses the button for production.

Continuous deployment. Every change that passes the pipeline is released to production with no manual approve. It is a policy on top of continuous delivery, not a different CI server.

I will say which one the team actually needs. A payments service may want continuous delivery with an approve; an internal tool may want continuous deployment. Neither works without a trustworthy test suite and a rollback (previous image, feature flag, or forward fix).

commit -> CI: build + test          # every branch / every main commit
       -> deliver: artefact is releasable
       -> deploy: artefact goes to production
# continuous delivery stops before the last arrow until someone approves
# continuous deployment walks the last arrow automatically
Sources (2)
  1. Martin Fowler: Continuous Integrationmartinfowler.com
  2. Martin Fowler: Continuous Deliverymartinfowler.com