Operations · Operations & process management
Continuous integration/continuous deployment (CI/CD)
Best for Early Startup to Startup
Use it when
Your team already merges to a shared mainline daily, but getting a change into production is slow, manual or risky, and you need every passing change ready to release.
Skip it when
- Developers still merge long-lived branches and the build breaks often. Use Continuous integration first, which this pipeline builds on.
- You need to find which delivery constraint to fix before you build anything. Use DORA metrics for DevEx to set the baseline and pick the constraint.
What to apply first and what to use instead are listed below.
Approaches
Continuous delivery
Every change that passes the pipeline is ready to release, and a person releases it to production with one button when the business chooses.
- Pro It works for regulated, firmware or mainframe products, and the business keeps control of release timing.
- Con Finished changes can wait for a release decision, so batches grow again if releases are rare.
Continuous deployment
Every change that passes all pipeline stages goes to production automatically, often many times a day.
- Pro Changes reach users within minutes of passing, and batches stay as small as the commits.
- Con It needs strong automated tests, monitoring and fast rollback, since no person checks the release.
Inputs
- Working continuous integrationA shared mainline, a one-command build and a commit build that runs on every push, from the existing CI setup.
- Automated testsUnit tests plus automated acceptance tests for the main user journeys, kept in the repository.
- Deployment scripts and configurationScripts that prepare an environment and deploy, plus configuration for each environment, held in version control.
- Artifact repositoryA store for each built package, labeled by version, so later stages deploy the same build.
- Target environmentsTest, staging and production environments, with staging as close to production as you can afford.
- Current delivery baselineOptionalLead time from commit to production, deployment frequency, change fail rate and recovery time for the last three months, from deploy logs and incident records.
Steps
- Draw today's path from commit to production as a series of stages, and record each stage's time, wait and manual steps.
- Build each change once in the commit stage, store the package in the artifact repository, and pass that same package to every later stage.
- Script the deployment so one command deploys any version to any environment, using the same process everywhere and keeping configuration out of the package.
- Add later stages that run the acceptance tests and other checks in production-like environments, in parallel where you can, and keep manual checks only for what cannot be automated.
- Set the release gate, a person's one-click approval or automatic release, and add production monitoring and a tested way to roll back.
- Review lead time, deployment frequency, change fail rate and recovery time monthly, and remove the slowest or most manual stage next.
Output
A running deployment pipeline from commit to production, with a one-page pipeline spec and a monthly delivery measures table.
- Stage and what it runs
- Trigger (automatic or approval)
- Typical duration
- Manual steps remaining
- Release gate and who can release
- Rollback method and last test date
- Lead time, deployment frequency, change fail rate and recovery time
Done when
- Every change merged to the mainline enters the pipeline without a manual step.
- The package deployed to production is the same build that passed every earlier stage.
- A production deployment runs from one command or button, with no manual environment work.
- The release gate is written down, and a rollback has been tested in the last quarter.
- A baseline for the four delivery measures is recorded before the first pipeline release.
Measure
Track lead time from commit to production, deployment frequency, change fail rate and recovery time monthly for six months, against the baseline you recorded before the pipeline. It worked when lead time falls and releases become more frequent while change fail rate and recovery time hold or improve. Also count the manual steps left in the pipeline each month, and expect that count to fall.
Hypothetical example
Fernhill Ledger, a 12-person accounting software team, released every three weeks after two days of manual setup and testing. Its lead time from commit to production averaged 16 days. The team stored each build in an artifact repository, scripted deployment for test, staging and production, and moved 40 manual regression checks into an automated acceptance stage. They chose continuous delivery with a one-click release because customers wanted notice of changes. After four months they released twice a week, lead time averaged three days, and the change fail rate stayed near its earlier level.
Common mistakes
- Rebuilding the code for each environment. Build once and deploy the same package everywhere.
- Scripting a fragile manual deployment exactly as it is. Simplify the process and the architecture, then automate it.
- Raising release frequency before tests and rollback are ready. Add automated acceptance tests, monitoring and rollback first.
Sources
- Continuous Delivery · Martin Fowler, 2013
- Deployment Pipeline · Martin Fowler, 2013
- Continuous Delivery · Jez Humble, 2010
Show all 5 sources
By company stage
Apply first
- Continuous integrationOperations · Operations & process management
CI/CD includes continuous integration; you need CI as a concept before the combined CI/CD practice.
Use instead
- Continuous integration
Developers still merge long-lived branches and the build breaks often. Use Continuous integration first, which this pipeline builds on.
- DORA metrics for DevEx
You need to find which delivery constraint to fix before you build anything. Use DORA metrics for DevEx to set the baseline and pick the constraint.
Where it sits
Open the operations & process management roadmapRecommended resources
No sponsored resources on this framework yet. Sponsored listings would be labelled here, never in search.
Progress is not saved until you have an account. Create a free account