Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Stages

Direct answer

Stages divide a Jenkins pipeline into named phases such as Build, Test and Deploy, shown in the stage view, and can run conditionally with when or in parallel.

When to use this

Use this when dividing Jenkins pipelines into stages.

First 30 seconds

1. Stages group steps.

2. Clear names (Build, Test, Deploy).

3. Parallel where independent.

4. Fail fast.

5. Visualised in stage view.

Operational verification

stage → steps

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Jenkins controller/agent and Pipeline automation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformJenkins controller/agent and Pipeline automation · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when dividing Jenkins pipelines into stages.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

The negative fixture should deliberately exercise risks such as controller/agent drift, plugin behavior changes, workspace contamination, credential leakage, retrying non-idempotent stages and green Pipeline status masking bad external state, choosing the cases most relevant to stage ordering/parallelism, conditions/post actions, stage-specific agents and distinguishing stage success from artifact/deployment correctness.

Step 2 Common mistakes Narrow the fault
  • One giant stage, hiding where failures happen.
  • Parallel stages writing to the same files.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Stages are named phases like Build, Test, Deploy.
  • when{} makes stages conditional.
  • parallel{} runs stages at once.
Key checks
  • Stage names and order — structure
  • Parallel stages — speed
  • Stage timing — bottlenecks
ReferenceWhy it matters1 section · depth on demand

What it is

Stages group pipeline steps (Build, Test, Deploy) and show progress in the UI; a failed stage stops later ones.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

Stages divide a pipeline into named phases — lint, test, build, deploy — that appear in the UI and logs. They show at a glance where a run failed and how long each phase takes, and they are the unit for conditions, approvals, parallelism and agents.

stages {
  stage('Validate') {
    parallel {
      stage('YAML')    { steps { sh 'yamllint .' } }
      stage('Ansible') { steps { sh 'ansible-lint' } }
    }
  }
  stage('Deploy test') { steps { sh './deploy.sh test' } }
  stage('Deploy prod') {
    when { branch 'main' }
    input { message 'Deploy to production?' }
    steps { sh './deploy.sh prod' }
  }
}

Keep stage names stable: dashboards and stage-level metrics depend on them.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docJenkins controller/agent and Pipeline automation current

Authoritative/upstream documentation reviewed for bounded claims in Jenkins > Stages. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.jenkins.io/doc/book/pipeline/syntax/ · confidence 94%
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

For stage ordering/parallelism, conditions/post actions, stage-specific agents and distinguishing stage success from artifact/deployment correctness, prefer typed fields and stable IDs over human presentation text.

Confirmation

Confirm action

Continue?