Releasing and running it · lesson 5 of 10
Ideas in this lesson
AContinuous deliveryalways releasable; release is a button
BContinuous deploymentevery green change goes to production by itself
CDeployment pipelineCI, extended all the way to production

Continuous delivery and deployment

Last updated

CI checks every change. But a checked change still has to reach the health centre, and if that takes a day of careful manual steps, releases become rare, big and frightening. Continuous delivery keeps Pila always ready to release, at the press of a button; continuous deployment takes away the button. In this lesson you'll tell the two apart, put a deployment pipeline's stages in order, and decide where Pila keeps a person in the loop.

By the end of this lesson you can

  • Tell continuous delivery from continuous deployment
  • Order the stages of a deployment pipeline, from commit to production
  • Decide where a human approval belongs, and why

Always releasable

Jez Humble and David Farley's 2010 book Continuous Delivery starts from a question: why are releases so painful? Their answer: because they're rare. A release every three months holds three months of changes, done by hand, by people who last did it three months ago.

Their fix is to make releasing boring. Continuous delivery means the main branch is always in a releasable state, every change goes through the same automated deployment pipeline, and putting a version into production is a routine decision, not a project. The pipeline is CI (lesson 7.2) carried all the way to production: the same image, built once, moves through test and staging to the real servers.

Delivery or deployment

Two names that differ by one thing: the button.

Delivery and deployment
Continuous deliveryContinuous deployment
Every change is built, tested and deployed to stagingYesYes
Going to productionA person presses a button, when they chooseAutomatic, as soon as every check passes
SuitsTeams that need to choose the moment: hospitals, banks, a health centre with a morning rushTeams with strong automated checks and fast rollback, such as many web companies

Both rest on the same pipeline; the difference is only who decides the last step. Pila uses continuous delivery: Bea, the product owner, chooses the time with Ate Cora, usually after 11:00 when the queue is quiet.

Build Pila’s deployment pipeline

Put the stages in order, cheapest and fastest checks first, and the riskiest step last.

  1. 1 Deploy the image to staging
  2. 2 Run the unit tests
  3. 3 Deploy the same image to production
  4. 4 Lint the code
  5. 5 Bea approves, at a time agreed with Ate Cora
  6. 6 Check production is healthy
  7. 7 Build the image
  8. 8 Smoke test on staging: text in, number out

The image is built once, at stage 3, and that exact image goes to staging and then production. Building again for production would mean releasing something nobody tested.

Watch it run

  1. Lint passed
  2. Test
  3. Build image
  4. Deploy to staging
  5. Smoke test
  6. Approve
  7. Deploy to production
  • ▶ running Show the next three numbers on the screen Marco
1 of 17 Marco pushes “Show the next three numbers on the screen”. The pipeline starts: Lint.
Bea’s build passed lint and every unit test. Why did the smoke test on staging catch it?

Spot the trap: the sticky note

Spot the trapJun

Pila’s pipeline stops at staging. Releasing to production is eleven manual steps, written on a sticky note on Jun’s monitor. Only Jun has done it.

What happens if…

Check what you learned

What is the one difference between continuous delivery and continuous deployment?
Why build the image once and deploy that same image to staging and production?
Why does Pila keep a person in the loop for production?

Sources

Every claim on this page comes from these sources: the standard, the founding text of a method, a study, or the official record of a project, from the body that publishes it. Industry reports are labelled as such.

All sources for Simple Software Development