graph LR;
A[Jenkins] -->|Defines| B[Pipeline];
A -->|Manages| C[Jobs];
A -->|Distributes Work| D[Nodes & Agents];
B -->|Defined in| F[Jenkinsfile];
B -->|Executes| G[Stages & Steps];
H[SCM ex:Git];
B -->|Produces| I[Artifacts];
B -->|Triggered by| J[Triggers];
C -->|Executed on| D;
C -->|Uses| H;
C -->|Generates| K[Builds];
C -->|Stores| L[Workspace];
D -->|Has| M[Executors];
D -->|Runs| K;
K -->|Generates| N[Logs & Console Output];
K -->|Stores| I;
K -->|Executes| O[Post-build Actions];
H -->|Triggers| J;
J -->|Can be| P[Webhook & Polling & Manual];
R[Blue Ocean] -->|Visualizes| B;
S[Credentials] -->|Used in| C;
S -->|Securely Stores| T[Passwords & API Keys];
U[Environment Variables] -->|Used in| C;
Using Jenkins with Code Defined Pipelines
flowchart TB
%% Main Focus
A["Using Jenkins with Code Defined Pipelines"] -->|Operates in| B["Jenkins Environment"]
A -->|Realized as| C["Code Defined Pipeline"]
%% Jenkins Environment branch
B -->|Manages| D["Jobs & Builds"]
B -->|Distributes work via| E["Nodes & Agents"]
B -->|Enhances functionality with| F["Plugins"]
%% Code Defined Pipeline branch
C -->|Expressed through| G["Pipeline as Code"]
C -->|Configured with| H["Jenkinsfile"]
C -->|Integrates with| I["SCM (e.g., Git, SVN)"]
C -->|Initiated by| J["Triggers (Webhook, Polling, Manual)"]
C -->|Produces| K["Artifacts & Logs"]
%% Additional relationships and details
H -->|Is stored in| I
K -->|Leads to| L["Post-build Actions"]
%% Cross-link: Plugins support pipeline capabilities
F ---|Supports| G
Concepts list
1. Pipeline
A series of automated steps that define how a project is built, tested, and deployed.
Can be defined using a Jenkinsfile written in Groovy-based DSL.
Supports both Declarative and Scripted pipeline syntaxes.
2. Job (Project)
Represents a unit of work in Jenkins.
Can be a Freestyle Job (configured via UI) or a Pipeline Job (defined via a Jenkinsfile).
Types of jobs include:
Freestyle Project
Pipeline
Multibranch Pipeline
Folder (for grouping jobs)
External Job (to track work done outside Jenkins)
3. Node (Agent)
A machine (physical or virtual) that runs build tasks.
Master-Agent Architecture allows distributing workload across multiple nodes.
Controller (formerly Master): Coordinates jobs and assigns work to agents.
Agent (formerly Slave): Executes jobs as per the controller’s instructions.
4. Executor
A thread that runs on an agent to execute a job.
Each agent has a configurable number of executors.
5. Workspace
A directory where Jenkins checks out code, builds, and tests applications.
Each job has a separate workspace on the assigned agent.
6. Build
A single execution of a job.
Each build has a unique build number and stores logs, artifacts, and results.
7. SCM (Source Code Management)
Jenkins integrates with Git, SVN, Mercurial, etc.
Can automatically trigger jobs when new changes are detected in the repository.
8. Triggers
Define when a job should start, such as:
Webhook Triggers (e.g., GitHub, GitLab)
Polling SCM (Jenkins periodically checks for changes)
Scheduled Jobs (Cron-like syntax)
Manual Triggering
9. Artifacts
Output files generated by a build (e.g., JAR, WAR, logs, reports).
Can be stored in Jenkins or external artifact repositories (Nexus, Artifactory).