05.2.1 · Skill in Release engineering

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.

Your status · CI/CD pipelines

Saved in this browser. Sign in to keep it on every device.It colours this skill's tile on your map.

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

  1. Merge work into the main branch at least once a day. Hide unfinished features behind a flag instead of keeping long branches.
  2. Run the build and the tests on every push, and make the result visible to the team.
  3. Keep the tests fast and reliable. A test that fails at random teaches people to ignore red builds.
  4. Fix a broken main branch before anything else.
  5. Automate the deployment, with the same steps every time, and checks after it.
  6. 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.

Loop

The cycle of continuous delivery, as Google's SRE workbook describes it

1234Automated releasesEach turn makes the next one safer
  1. 1Release more oftenNo manual steps to wait for.
  2. 2Fewer changes per releaseEach one is easy to check.
  3. 3Cheaper rollbacksUndo one small change, not a month.
  4. 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 min

    The habits behind real continuous integration, including merging to trunk at least daily.

  • docsStart here
    Continuous delivery ↗
    DORA (Google Cloud) · 10 min

    What it takes for releasing to become routine, low-risk and possible at any time.

  • articleGo deeper
    Continuous integration ↗
    Martin Fowler · 60 min

    The definitive explanation of continuous integration, recently revised, including what it is not.

Tools

1