Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Pipeline · Jenkins

Direct answer

A Jenkins pipeline models the whole build, test and deploy process as code, with stages that show progress and can pause for approval.

When to use this

Use this when modelling build, test and deploy in Jenkins.

First 30 seconds

1. Pipelines define builds as code (Groovy DSL).

2. Store Jenkinsfile in repo.

3. Multibranch pipelines.

4. Shared libraries.

5. Visual history.

Operational verification

Jenkinsfile → pipeline run → stages

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 modelling build, test and deploy in Jenkins.
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.

3 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

Record controller, job/folder, build number, stage/step, agent and artifact IDs; inspect the runtime/control-plane result; then query the build/test/package/deployment result and any external system mutated by the Pipeline through an independent read path and compare it with the versioned intent. 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 SCM revision, stage/step graph, agent allocation, artifacts, credentials and final external target verification. For Jenkins → Pipeline, the evidence must connect the control-plane result to the build/test/package/deployment result and any external system mutated by the Pipeline and explain any gap between desired, controller-reported and consumer-visible state.

Step 2 Common mistakes Narrow the fault
  • Pipelines without timeouts.
Step 3 Where it fails Narrow the fault

Common failure classes include controller/agent drift, plugin behavior changes, workspace contamination, credential leakage, retrying non-idempotent stages and green Pipeline status masking bad external state.

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
  • Pipelines model build, test and deploy as code.
  • Stages show progress.
  • input steps pause for approval.
Key checks
  • Pipeline job type — as code
  • Stage view/Blue Ocean history — runs
  • Replay disabled for sensitive pipelines — control
ReferenceWhy it matters1 section · depth on demand

Worked example

A Jenkins pipeline describes the whole build and delivery process as code (a Jenkinsfile), from checkout to deployment. Pipelines survive controller restarts, can pause for input, run stages in parallel and are versioned with the project.

Worked example — a pipeline for an Ansible repository:

pipeline {
  agent { docker { image 'registry.example.com/ansible-ee:2.16' } }
  options { timeout(time: 45, unit: 'MINUTES'); buildDiscarder(logRotator(numToKeepStr: '30')) }
  stages {
    stage('Lint')    { steps { sh 'yamllint . && ansible-lint' } }
    stage('Preview') { steps { sh 'ansible-playbook site.yml -i inventories/prod --check --diff | tee preview.txt' } }
    stage('Apply') {
      when { branch 'main' }
      steps { input message: 'Apply to production?', submitter: 'netops-leads'
              sh 'ansible-playbook site.yml -i inventories/prod' }
    }
  }
  post { always { archiveArtifacts 'preview.txt' } }
}
ReferenceImportant terms & boundaries1 section · depth on demand

Mechanics

Jenkins → Pipeline is owned at runtime by the Jenkins controller, queue, Pipeline engine and selected agents/executors. The consumer-visible target is the build/test/package/deployment result and any external system mutated by the Pipeline. The linked authority for bounded mechanics is Jenkins Handbook — Pipeline; documentation support is separate from observed lab/production Evidence.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
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 > Pipeline. Documentation verification only; this is not observed lab or production Evidence.

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

Deep reference

Healthy vs suspicious evidence

Output interpretation

For SCM revision, stage/step graph, agent allocation, artifacts, credentials and final external target verification, prefer typed fields and stable IDs over human presentation text.

Confirmation

Confirm action

Continue?