CI/CD pipelines
Automatically building, testing and delivering every change.
Continuous integration merges and tests changes often. Continuous delivery keeps the code always releasable. Together they make releasing routine instead of an event.
Why it matters for a product engineer
A pipeline that builds, tests and deploys every change makes releasing routine. Routine releases are small, and small releases are easy to check and easy to undo. For a product engineer this is the difference between shipping an idea today and waiting for “release day”, with a pile of changes that nobody can untangle when something breaks.
How to do it
- Merge work into the main branch at least once a day. Hide unfinished features behind a flag instead of keeping long branches.
- Run the build and the tests on every push, and make the result visible to the team.
- Keep the tests fast and reliable. A test that fails at random teaches people to ignore red builds.
- Fix a broken main branch before anything else.
- Automate the deployment, with the same steps every time, and checks after it.
- Measure how long a change takes from commit to production, and shorten the slowest step.
Common mistakes
- Long-lived branches merged once a week, with big conflicts.
- A pipeline that takes an hour, so people stop waiting for it.
- Manual steps in the deployment that only one person knows.
- Flaky tests that everyone reruns until they pass.
- Calling it continuous delivery while releases still happen once a month.
Example
DORA’s research found that teams perform better when developers merge into the main branch at least daily. Google’s SRE team describes the result as a cycle that feeds itself: automated releases let a team release more often; each release then carries fewer changes; smaller releases are cheaper to roll back; and fixes reach users sooner.
The cycle of continuous delivery, as Google's SRE workbook describes it
- 1Release more oftenNo manual steps to wait for.
- 2Fewer changes per releaseEach one is easy to check.
- 3Cheaper rollbacksUndo one small change, not a month.
- 4Fixes reach users soonerAnd trust in releasing grows.
The speed and the safety come from the same habit: many small releases.
The Site Reliability Workbook, chapter 16, Google
Sources: Continuous integration (DORA) ↗ · Canarying releases (The Site Reliability Workbook, chapter 16, Google) ↗
Resources
3- docsStart here
Continuous integration ↗
DORA (Google Cloud) · 7 minThe habits behind real continuous integration, including merging to trunk at least daily.
- docsStart here
Continuous delivery ↗
DORA (Google Cloud) · 10 minWhat it takes for releasing to become routine, low-risk and possible at any time.
- articleGo deeper
Continuous integration ↗
Martin Fowler · 60 minThe definitive explanation of continuous integration, recently revised, including what it is not.
Tools
1- ToolFreemium
GitHub Actions
CI/CD built into GitHub, for running tests, checks and deployments on every change.