Jenkins is an open-source automation server that orchestrates continuous integration and continuous delivery (CI/CD) workflows through pipelines defined as code. Originally forked from Hudson in 2011, Jenkins powers CI/CD pipelines across millions of projects by executing builds, running tests, and deploying applications through a distributed architecture of controllers (formerly masters) and agents (formerly slaves). Its plugin ecosystem of 2000+ plugins β combined with Pipeline-as-Code via Jenkinsfiles stored in source control β enables teams to automate every stage from commit to production. A key mental model: Jenkins itself does almost nothing; all real work is delegated to agents, orchestrated by the controller, and expressed as code in a Jenkinsfile.
What This Cheat Sheet Covers
This topic spans 28 focused tables and 266 indexed concepts, 183 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Pipeline Types
The first decision on any new Jenkins setup is how you express a pipeline. Declarative and Scripted are the two ways to write a single Jenkinsfile, while Multibranch, Organization Folder, and Shared Library are scaling patterns layered on top β auto-discovering branches, whole orgs, or factoring common logic into a reusable repo.
| Type | Example | Description | |
|---|---|---|---|
pipeline { agent any stages { stage('Build') { steps { sh 'make' } } }} | β’ Structured syntax with predefined sections ( pipeline, agent, stages, steps)β’ enforces best practices and provides clear validation errors; preferred for new pipelines. | ||
node { stage('Build') { sh 'make' }} | β’ Groovy-based imperative syntax offering maximum flexibility for complex logic β’ uses node blocks; reserve for cases Declarative cannot handle. | ||
Automatically scans repository for branches with Jenkinsfile | β’ Auto-discovers branches and PRs and creates sub-pipelines for each β’ single job definition manages unlimited branches. | ||
Scans entire GitHub/Bitbucket/GitLab org | β’ Discovers all repositories in an organization and creates multibranch jobs automatically β’ preferred over multibranch for enterprise scale. | ||
('my-lib') _buildApp('java') | β’ Reusable pipeline code stored in a separate Git repo; loaded with @Libraryβ’ eliminates duplication across projects; structure: vars/, src/, resources/. |