Pipeline Stages, Artifacts, and Rollback
coreintermediateA pipeline describes how a code change reaches production. It is a series of stages — source, build, test, deploy — and each stage contains actions that operate on artifacts: the source tree, the built package, the deployment definition. The build stage produces an artifact once, and every later stage deploys that same artifact rather than rebuilding it.
Think of it as
A pipeline is an assembly line, and the artifact is the thing moving along it. The single most important rule follows from that image: the object tested in staging must be the same object deployed to production. Rebuilding between stages is putting a different item on the belt and hoping it is identical.
What we're doing: Understand why "it worked in staging" is only meaningful when the artifact is shared.
- 2
- Nothing here looks wrong. The Dockerfile is the same, the commit is the same — only the resolved dependency tree differs, which is exactly the class of difference nobody notices.
- 8
- Building once and promoting by digest makes "tested in staging" a statement about the production artifact rather than about a sibling of it.
Why this works: The value of a lower environment comes entirely from it running the same thing production will. A pipeline that rebuilds per stage keeps the ceremony of testing and loses the guarantee, and the resulting failures are the hardest kind to reproduce.
Deploying by mutable tag instead of by digest
Wrong
Better
What you see: Two tasks in the same service run different code, because one started before the tag was repointed and one after — and the service reports healthy throughout.
Why: A tag is a mutable pointer. Anything that pulls by tag resolves it at pull time, so a scale-out or a task replacement hours later silently picks up whatever the tag means then. A digest names specific bytes and cannot drift.
- Source — commit or tag triggers the pipeline
- leads to Build (triggers)
- Build — produces the artifact — once
- leads to Test (output artifact)
- Test — against that artifact
- leads to Deploy staging (same artifact)
- Deploy staging — same artifact
- leads to Approval (gate)
- Approval — human gate
- leads to Deploy production (promote)
- Deploy production — same artifact again
What belongs in each stage
Together
Remember: Source → build → test → deploy → approval → deploy, with one artifact flowing through all of it. Build once, promote by digest, and make rollback a configured path rather than a forward fix written during an incident.
See also: aws cicd services and alternatives · deployment strategies

