System Atlas
the atlas

CI/CD pipeline explained

Turn every commit into a tested, shippable, deployable artifact — automatically.

the gist

Continuous Integration means every commit automatically triggers a build and test run so problems surface early. Continuous Delivery/Deployment means passing builds are automatically delivered onward. A pipeline chains commit → build → tests → package → deploy to staging → approval → deploy to production, with rollback if something breaks.

ANALOGY // An assembly line with quality gates: each station checks the product, and it only moves forward if it passes — with a lever to yank a bad unit back off the line.
living diagram01 / 06
CommittriggerBuildcompileTestsautomatedArtifactpackageStagingdeployProductionapproval → deploy
01

Commit

A developer pushes code to the shared repository, and that push is the automatic trigger for the whole pipeline — no one runs anything by hand. Because integration happens on every commit rather than at release time, conflicts and breakages surface while the change is still small and fresh in the author's mind. Frequent, small commits are what make the rest of the pipeline fast and low-risk.

02

Build

The pipeline checks out the code, resolves dependencies, and compiles it in a clean, disposable environment so the result doesn't depend on any one machine's setup. If the build itself is broken it fails immediately, giving fast feedback before any expensive later stages run. A clean build environment is also what makes the result reproducible.

03

Automated tests

Unit, integration, and often linting and security scans run automatically against the fresh build. A single red test stops promotion right here, so a broken change never advances — this fast-fail gate is the heart of Continuous Integration. The goal is to catch defects in minutes, when they are cheapest to fix.

04

Package artifact

A build that passes tests is packaged exactly once into a versioned, immutable artifact — typically a Docker image tagged with the commit. That same artifact is then promoted unchanged through every later environment, so what you tested is byte-for-byte what you ship. Building once and promoting eliminates 'it rebuilt differently' surprises.

05

Deploy to staging

The artifact is deployed automatically to a staging environment that mirrors production as closely as possible. Here it faces realistic data, smoke tests, and sometimes end-to-end or performance checks — a final rehearsal before the real thing. Catching an issue in staging costs a redeploy; catching it in production costs an incident.

06

Approval → production

After an optional manual approval gate (the line between Continuous Delivery and full Continuous Deployment), the identical artifact is released to production, often via a gradual strategy like canary or blue-green. Rollback is a first-class step: if health metrics dip, traffic is shifted back to the last good version fast. Shipping small and reversibly is what makes frequent deploys safe.

the full picture
01

The problem: integration pain and release fear

Before automation, software teams suffered two recurring agonies. The first was integration hell: developers worked on separate branches for weeks, and when they finally merged, their changes collided in ways nobody had tested. The longer branches diverged, the more painful and surprising the merge — bugs that only appeared when everyone's work met for the first time, days before a deadline.

The second was release fear. Deployments were rare, manual, all-at-once events, run late at night by whoever knew the incantations. Because they were rare they were huge, and because they were huge they were terrifying: a release bundled hundreds of changes, so when something broke, finding the culprit meant sifting through all of them. Teams responded by deploying even less often, which made each release bigger and scarier still — a vicious cycle.

CI/CD attacks both problems with the same medicine: do the scary thing constantly, automatically, and in small pieces. Integrate every commit so collisions are tiny and caught immediately. Deploy small changes often so each release is boring and easy to reason about. The counter-intuitive truth at the heart of the discipline is that doing something more frequently makes it safer, not riskier, because the batch size shrinks and the feedback loop tightens.

02

CI vs CD: two halves that are often confused

The acronym bundles two related but distinct practices, and it helps to separate them cleanly.

Continuous Integration (CI) is about the code being correct. Every time anyone commits, an automated system builds the project and runs the test suite. The purpose is fast feedback: if a change breaks the build or a test, the author learns within minutes, while the context is fresh and the change is small. CI keeps the main branch in a permanently healthy, releasable state.

Continuous Delivery / Deployment (CD) is about getting that correct code to users. There is a subtle but important distinction inside the "CD":

  • Continuous Delivery means every change that passes CI is automatically prepared and pushed all the way to a staging environment, so it is *always ready* to release — but the final push to production is a manual, one-click decision by a human.
  • Continuous Deployment removes even that button: every change that passes all automated checks goes to production automatically, with no human gate.

So the split is roughly: CI answers "does this change work?"; CD answers "how does working code reach users?". The manual approval gate is the single dividing line between Delivery and Deployment — and which one a team chooses depends on how much they trust their automated tests.

03

The pipeline stages, and the artifact that ties them together

A pipeline is a chain of automated stages, each a gate: a change only advances if the previous stage passes. A typical shape is:

  • Source / trigger — a commit or pull request kicks everything off automatically.
  • Build — compile the code and resolve dependencies in a clean environment; fail fast if it won't even build.
  • Test — run unit tests, integration tests, linting, and security scans. This is the primary CI quality gate.
  • Package — bundle the passing build into a deployable artifact.
  • Deploy to staging — release the artifact to a production-like environment for smoke and end-to-end checks.
  • Deploy to production — release the same artifact to users, possibly after an approval.

The concept that makes this trustworthy is the immutable artifact, built exactly once at the package stage — usually a versioned Docker image tagged with the commit hash. That one artifact is then promoted unchanged through staging and production. This is non-negotiable: if you rebuilt at each stage, subtle differences (a dependency that updated, a different build machine) could mean the thing in production is not the thing you tested. Build once, promote the identical artifact everywhere, and "it worked in staging" becomes a real guarantee rather than a hope.

04

Environments and safe deployment strategies

Code flows through a ladder of environments, each closer to reality: typically development, then staging (a mirror of production used for final validation), then production (real users, real data). The ladder exists so that risk is discovered where it is cheap. A bug caught in staging costs a redeploy; the same bug in production costs an incident and possibly lost trust.

Even with good tests, pushing a new version to all users at once is risky, so mature pipelines use progressive delivery strategies to limit and reverse the blast radius:

  • Rolling update — replace old instances with new ones a few at a time, so there is never full downtime and only a fraction runs the new version at any moment.
  • Blue-green — run two identical production environments; deploy to the idle one ("green"), test it, then switch all traffic over at once. Rollback is instant: flip traffic back to "blue".
  • Canary — route a small slice of real traffic (say 5%) to the new version, watch its error rate and latency, and only widen the rollout if the metrics stay healthy — otherwise pull it.

Underpinning all of these is rollback as a first-class, rehearsed capability. Because the last-known-good artifact still exists and is immutable, recovering from a bad release is a fast, boring operation rather than a frantic rebuild. The whole design assumes things will occasionally go wrong and makes undoing them cheap.

05

Trade-offs, failure modes, and getting real value

CI/CD is not free, and pretending otherwise leads to pipelines that technically exist but deliver no confidence.

The dependence on tests is total: an automated pipeline is only as trustworthy as the suite gating it. A pipeline with poor test coverage doesn't prevent bad deploys — it *accelerates* them, shipping bugs to production faster than ever. Investment in a fast, reliable test suite is the price of entry.

Common failure modes to watch for:

  • Flaky tests — tests that fail intermittently for no real reason. They are corrosive because they train the team to ignore red builds, which defeats the entire point of the gate.
  • Slow pipelines — if a run takes an hour, developers stop waiting for feedback and batch up changes, reviving the very problem CI was meant to kill. Parallelising stages and caching dependencies keeps runs fast.
  • Snowflake environments — staging that has drifted from production so its passing result means little. Infrastructure-as-code and containers keep environments identical.
  • Skipped gates — "just this once" manual deploys that bypass the pipeline, which erode the guarantees everyone relies on.

Done well, though, the payoff is large: changes reach users in minutes instead of weeks, releases become frequent and unremarkable, failures are caught early and reverted quickly, and the team's whole relationship to shipping shifts from dread to routine. CI/CD is less a set of tools than a discipline — small batches, automated gates, immutable artifacts, and cheap rollback — and it rests directly on containers for reproducible builds and, often, on an orchestrator to run the deploys.

what to remember
01

CI: each commit automatically builds and runs tests, catching integration issues within minutes.

02

CD: builds that pass are automatically packaged and delivered or deployed onward.

03

The pipeline is a chain of gated stages — a failure at any stage stops promotion.

04

A packaged artifact (image or bundle) is built once and promoted unchanged through environments.

05

Rollback is a first-class step: if production breaks, you revert to the last good artifact fast.

check yourself

Quick quiz

Q1

What does Continuous Integration primarily buy you?

Q2

Why is the artifact built once and promoted unchanged?

follow the thread