1.Pipeline Stages, Artifacts, and Rollback
A 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.
Key features
- A pipeline is a workflow made of stages; a stage isolates an environment and limits how many concurrent changes reach it
- Valid CodePipeline action types are `source`, `build`, `test`, `deploy`, `approval`, and `invoke`, and actions in a stage can run in series or in parallel
- Artifacts are produced by some actions and consumed by others — input artifacts and output artifacts — and are passed between actions through the pipeline artifact bucket
- A stage is locked while it processes an execution, so two executions cannot occupy the same stage at once
- In the default SUPERSEDED execution mode a newer execution replaces an older one waiting to enter a locked stage; PARALLEL and QUEUED modes behave differently
- A failed stage can be retried or rolled back to a specified previous successful execution — automatically, if configured — and an approval action is the human gate that makes "production requires a person" a pipeline property rather than a convention
What belongs in each stage
- 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
Signature
pipeline ⊃ stages ⊃ actions (source | build | test | deploy | approval | invoke) · artifacts flow between them
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.