Continuous integration and the deployment pipeline
What CI really requires, and how a pipeline turns every commit into a release candidate or a fast, clear rejection.
Integration is a behaviour, not a server
Continuous Delivery is explicit that continuous integration is a practice the team follows. Owning a CI server is not enough. Its prerequisites are modest: everything in version control, an automated build and test you can run from the command line, and an agreement. The agreement is the hard part:
- Merge small changes into the mainline at least once a day.
- Run the build and tests locally before pushing.
- Never push on a broken build, and fix or revert a break immediately.
- Do not go home with the build broken.
Accelerate gives this empirical weight. In its research, trunk-based development, with few active branches living less than a day and no code freezes, was among the capabilities that predicted higher delivery performance. Long-lived feature branches look safe, but they postpone integration until the moment when it is most expensive.
The deployment pipeline
A pipeline models the path from commit to production as stages. Each stage takes the same release candidate and increases confidence in it. Each stage may also reject it:
- Commit stage (minutes): compile, run unit tests, run static analysis, and build the artifact. Failures here are cheap and fast to fix.
- Automated acceptance stage: deploy the artifact to a production-like environment and test behaviour against requirements.
- Further test stages as needed: performance, security, and exploratory or manual testing.
- Release: deploy the proven artifact to production, ideally with one push-button or automatic step.
Two properties make this work. Fast feedback first: the stages most likely to fail and cheapest to run come earliest. Every stage is a gate: a red stage stops that candidate. A pipeline is valuable because a green result means something.
The cost of "advisory" stages
Teams under pressure sometimes mark a slow or flaky stage as advisory, with continue-on-error, allow_failure, or a manual "ignore". The pipeline turns green while one of its claims is false, and deploys proceed. That is the situation in the lab. The real problem is usually upstream. The tests are too slow, too flaky, or testing the wrong thing. Fix that directly by speeding them up, quarantining flaky tests with an owner and a deadline, or moving them to the right stage. Do not keep a gate that cannot close.
Stop the line
Borrowed from lean manufacturing, the rule is that a broken mainline is everyone's top priority. While it is red, new pushes stack untested changes on top of a known failure, and the next failure is hidden. Continuous Delivery recommends a time limit: if the break cannot be fixed within minutes, revert the offending commit and fix it calmly. Revert is not a defeat. It restores the pipeline's ability to tell the truth.
What "continuous delivery" means
The book's working definition is that the software is always in a releasable state, and releasing is a business decision rather than an engineering project. Continuous deployment goes one step further and releases every green candidate automatically. Either way, the pipeline is the mechanism that makes "releasable" a checked fact rather than a hope.
Key terms
- Continuous integration
- Everyone merges small changes into the mainline at least daily, and each merge is built and tested automatically. A broken build is fixed immediately.
- Deployment pipeline
- The automated path from a commit to production, in stages, where each stage gains confidence in one release candidate.
- Commit stage
- The first, fast stage, which compiles, unit-tests, analyses, and packages the artifact. It should take minutes.
- Trunk-based development
- Working in short-lived branches (or directly on trunk) that merge within a day or so, rather than long-lived feature branches.
Read further
- Continuous Delivery, Ch. 3, "Continuous Integration" (Purchase; summaries are free on the book's site)
The prerequisites (version control, an automated build, team agreement) and the essential practices, especially "don't check in on a broken build" and "never go home on a broken build". - Continuous Delivery, Ch. 5, "Anatomy of the Deployment Pipeline" (Purchase; summaries are free on the book's site)
The stages from commit to release, the idea that each stage increases confidence in a release candidate, and the deployment pipeline practices listed in the chapter. - Accelerate, Ch. 4, "Technical Practices" (Purchase; DORA publishes the capability research free)
Which technical capabilities the research links to delivery performance, including continuous integration and trunk-based development, and how continuous delivery is defined and measured.