Pcornel
Automation

Jenkins

Cheat sheet · https://pcornel.dk/topic.php?topic=5533

Back to the Topic

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.

Remember

  • Run builds on agents, not the controller.
  • Keep plugins few and updated.
  • Pipelines belong in Jenkinsfiles in Git.

First 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

Verify in this order

SCM → Jenkinsfile → controller → agents → stages

Where it usually breaks

Automation/controller success is not target-state proof; target config/state is not effective-runtime proof; effective state is not workload proof.

→ Jenkins · operational reference

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

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5533

Confirmation

Confirm action

Continue?