BOOKS DEEP-READ · CONTINUOUS DELIVERY · CH 5

Anatomy of the Deployment Pipeline

Continuous Delivery · Ch 5 · Jez Humble & David Farley · 2010

中文 →

What is this chapter about?

The apps on your phone update every couple of weeks. Between a programmer changing one line of code and that line actually running on your phone, there is a road. Chapter 5 of Continuous Delivery is about what that road should look like. The authors call it the deployment pipeline, and it is the heart of the whole book.

An analogy

Think of a quality-control line in a factory. One code change is one item coming off the line, and it has to pass a series of inspection stations. The early stations are fast and cheap — a quick look, a weigh-in, done in minutes. The later ones are slow and expensive — open it up, run the full battery, wait half a day. If any station shows a red light, that item stops right there and is not allowed to move on.

Here is the counterintuitive part: the point of this line is not to prove a version is good enough to ship. It is to prove, as early and as cheaply as possible, that a version is not good enough. That is why the fastest, crudest checks go first — bad news is cheapest when it arrives early.

Why the old way was so painful

Releases used to happen on "release day": save up three months of changes, pick a Friday night, put a roomful of people in front of a forty-page instruction sheet, and type commands by hand. One mistyped step and you were rolling back until dawn. Worse, the machines used for testing looked nothing like the machines serving real customers, so "it passed in the test environment" proved very little. Nobody dared release often, so changes piled up, and bigger piles made every release riskier still.

Three rules that straighten this out

One: assemble it only once. The box that passed inspection is the box that ships — you never rebuild a fresh one halfway down the line. It sounds obvious, but the old habit was to recompile and repackage at every environment, which means the version that actually went live was never the one anybody tested.

Two: every station uses the same motions. Installing onto a test machine and installing onto a live machine use the same automated script; the only difference is the label on the box — the settings for that particular environment. And right after installing, the system checks itself: did it actually come up? Is everything it needs actually reachable?

Three: a red light stops the line. When a station goes red, the item stops and the whole team fixes the light before doing anything else. No routing around it, no "we'll get to it later."

What you get

Put the three together and releasing stops being a fire drill and becomes a button. At any moment you can see exactly where a version is, what it is stuck on, and whether it could go live. This is how companies like Amazon and Etsy came to ship dozens or hundreds of times a day — they paved the road first.

It does cost something: the line itself has to be built and maintained, and at the start it feels slower and noisier than the old way, with red lights going off constantly. The payoff only shows up once you are releasing often.

Remember this

Turn "code change to live" into one fixed, automated line: assemble once, same motions at every station, red light stops the line. Its job is not to prove you are right — it is to catch the versions that are wrong as early and as cheaply as possible. After which releasing is no longer an event; it is a button.

Want the stages, the time budgets and the diagrams? → Switch to the deep read