Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Jenkins

Direct answer

Jenkins is a self-hosted automation server for CI/CD. A controller schedules pipelines defined in Jenkinsfiles, and agents run the builds, extended by a large plugin ecosystem.

When to use this

Use this when running CI/CD pipelines on a self-hosted Jenkins server.

First 30 seconds

1. Jenkins: controller, agents, pipelines (Jenkinsfile), plugins, credentials.

2. Pipelines as code.

3. Keep core and plugins updated (frequent advisories).

4. No builds on the controller.

5. Credentials plugin with least privilege.

Operational verification

SCM → Jenkinsfile → controller → agents → stages

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Jenkins Pipeline current
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 Pipeline current · 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 running CI/CD pipelines on a self-hosted Jenkins server.
What next?3 suggested next steps
Child topics (this level)13
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 Target-state verification ladder Verify boundary

Jenkins uses a strict target-state ladder for pipeline stage/agent execution: request accepted → job/task succeeded → target object changed → effective runtime state confirmed → original workload verified.

Step 2 Verification path Verify boundary

Identify the exact job path/build number, Jenkinsfile revision, controller and agent/node used. Inspect stage/step results and test reports, not only the overall build badge. Re-run a bounded build from a known commit and show the expected agent/toolchain was selected. For deployment stages, capture the artifact digest/version, environment and deployment step result, then independently query the target service/version/health. Test controller restart or agent loss for a safe Pipeline to understand durability and retry behavior. For credentialed steps, verify permissions with a least-privilege identity and confirm secrets are masked. A build marked SUCCESS is intermediate evidence until any external target state required by the job has been read back.

Step 3 Where it fails Narrow the fault

Separate SCM/Jenkinsfile retrieval, controller scheduling/state, plugin/shared-library resolution, agent/workspace/toolchain, step/process execution, external API/deployment and final service verification. A controller may be healthy while no matching agent is online; a shell step can succeed but publish the wrong artifact; a deployment plugin can accept a request that later fails. Plugin upgrades can introduce behavior drift without Jenkinsfile changes. Do not rerun a failed deployment stage until you know whether the previous attempt mutated the target. Preserve build and external operation IDs, then inspect the earliest missing expected state. Recovery should address that layer and the original build/deployment verification should be repeated after correction.

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
Drill down

Subtopics

Go one level deeper into this subject.

Subtopic Jenkins Architecture

Jenkins architecture is a controller that schedules jobs and stores configuration, agents that run builds, plugins that add features, and pipelines defined as code in Jenkinsfiles.

Subtopic Controller

The Jenkins controller hosts the web UI, configuration, job definitions, credentials and scheduling.

Subtopic Agent

A Jenkins agent is a machine or container that runs build steps assigned by the controller, connected over SSH or inbound JNLP, selected by labels in the pipeline.

Subtopic Pipeline

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

Subtopic Jenkinsfile

A Jenkinsfile is the pipeline definition stored in the project's repository, so the build process is versioned and reviewed alongside the code.

Subtopic Declarative Pipeline

A declarative pipeline uses Jenkins' structured syntax — pipeline, agent, stages, steps, post — which is easier to read and validate than scripted pipelines and is the recommended style.

Subtopic Scripted Pipeline

A scripted pipeline is written in Groovy inside node { } blocks, giving full programming flexibility but less structure and validation than declarative pipelines.

Subtopic Stages

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.

Subtopic Steps

Steps are individual actions inside a Jenkins stage, such as sh, bat, git, junit or archiveArtifacts, provided by Jenkins core and plugins.

Subtopic Credentials

Jenkins credentials store passwords, SSH keys, tokens and certificates encrypted on the controller, used in pipelines with withCredentials or credentials() so they are masked in logs.

Subtopic Plugins

Jenkins plugins add integrations and features such as Git, credentials binding and pipeline steps.

Subtopic Artifacts

Jenkins artifacts are files kept from a build, saved with archiveArtifacts, such as packages or reports.

Subtopic Jenkins Troubleshooting

Troubleshoot Jenkins by reading the console output, checking agent connectivity and labels, plugin versions and compatibility, credentials IDs, workspace permissions and the system log.

Key points
  • Run builds on agents, not the controller.
  • Keep plugins few and updated.
  • Pipelines belong in Jenkinsfiles in Git.
Key checks
  • curl -sS -u <user>:<api-token> https://<jenkins>/api/json?tree=jobs[name,color] — job status via API
  • Jenkinsfile in repos — pipelines as code
  • Plugin update status — security
ReferenceWhy it matters1 section · depth on demand

In depth

Jenkins is a self-hosted automation server widely used for CI/CD. Pipelines are defined as code in a Jenkinsfile, executed by agents, and extended with a large plugin ecosystem.

ComponentRole
ControllerUI, scheduling, configuration
AgentsRun build steps (static, Docker, Kubernetes)
JenkinsfileDeclarative or scripted pipeline
PluginsSCM, credentials, notifications
Credentials storeSecrets injected into jobs

Keep the controller lean (no builds on it), update plugins regularly, and back up JENKINS_HOME — plugin sprawl and outdated plugins are the main operational risks.

ReferenceImportant terms & boundaries1 section · depth on demand

Mechanics

Jenkins is a controller/agent automation system whose Pipeline engine executes a Jenkinsfile or configured job as stages and steps. The controller schedules work and persists build metadata; agents provide workspaces/executors where steps actually run; plugins extend Pipeline steps and can materially change semantics. Declarative and Scripted Pipeline share the execution engine but expose different authoring contracts. Credentials bindings, environment variables, shared libraries and tool installations are resolved at runtime and can vary by folder/node. Pipeline durability can survive controller restart, but external side effects may not be transactionally replayable. A successful Jenkins build therefore shows configured steps concluded under a specific controller/plugin/agent context; it does not inherently show deployed service state.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Lifecycle

Store Jenkinsfiles and shared libraries in source control, review controller configuration as code where feasible, and manage plugins as versioned dependencies with tested upgrade paths. Treat controller backup, credentials, agents, toolchains and workspace cleanup as separate lifecycle responsibilities. Pin agent images/tool versions for reproducibility and restrict job/credential permissions by folder/team. Avoid embedding long-lived secrets in environment/logs. Define restart and retry semantics for stages that perform external mutations; use idempotent deployment logic or explicit checkpoints so resuming a Pipeline cannot duplicate unsafe side effects. Regularly test controller restore and agent replacement. Retain build metadata/artifacts according to audit needs without allowing unbounded storage growth.

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 Pipeline current current

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

Basis: https://www.jenkins.io/doc/book/pipeline/ · confidence 94%
Embedded reference data

Quick lookup tables

→ Jenkins · operational reference

Context-specific ownership, verification, output and failure-boundary lookup for → Jenkins.

LayerJenkins operational reference
Runtime/ownershipJenkins Pipeline current · identify controller/worker/target ownership before mutation
Persistent intentVersioned configuration/playbook/workflow with explicit dependencies and least-privilege identity
Verificationcurl -fsS "$JENKINS_URL/job/$JOB/lastBuild/api/json" / jq "{number,result,building,url}"
Expected interpretationThe job/pipeline definition revision, controller, agent/node, build number and result are known, and any deployed target is verified independently.
Recovery boundaryPreserve correlation IDs + pre-state, then verify target/service independently after remediation
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

Preserve job full name, build number/URL, SCM commit, queue/executor/agent identity, Pipeline stage/step results, test report counts, artifact digests and deployment IDs. Console log is diagnostic text; use Jenkins API and structured test/artifact metadata for stable comparisons. Distinguish queue time from execution time and controller failure from agent/step failure. Plugin-generated steps may emit their own external operation IDs—retain them for target correlation. If a stage is retried, record attempt boundaries. For parallel branches, keep branch-specific results rather than only the aggregate stage. Redact credentials and tokens; verify masking around shell tracing. External deployment verification should be reported separately from Jenkins build conclusion.

Confirmation

Confirm action

Continue?