Courses / Cloud and DevOps Interview Prep / Chapter 4
Module 3 · Pipelines and infrastructure as code · Chapter 4 of 13
CI/CD Pipelines: Verify, Release Gradually, Roll Back
Builds on Scripts and Git for Safe Change. Next up: Infrastructure as Code: State, Drift and Policy Checks.
Part 1 · What each stage proves
A pipeline is a chain of questions
A food-delivery team ships to production several times a day, and nobody stays up to watch each release. That works only because a pipeline asks the same questions of every change, in the same order, and stops at the first bad answer.
Continuous integration (CI) merges and tests every change automatically, so problems appear within minutes of the commit. Continuous delivery keeps the result always ready to release, and a deployment is then a button or a rule. A pipeline is the ordered set of automated stages from commit to production. Each stage proves one thing, and a stage that proves nothing new is cost without benefit.
The artifact matters as much as the stages. An artifact is the thing you deploy: a container image, an archive, a package. The rule that holds a pipeline together is build once, promote the same artifact. You build it at the start, test that exact build, and deploy that exact build to each environment. If every environment rebuilds from source, then the thing you tested is not the thing you shipped, even if the commit is the same.
Teams identify an artifact by its digest, a hash of its contents. With a strong hash such as SHA-256, two files with the same digest are, for every practical purpose, byte for byte identical. A tag like latest or v42 can be moved to a different build, so a tag is a label, and the digest is the identity. A hermetic build takes only declared inputs and has no hidden network or machine state, so the same inputs give the same output.