Introduction to CI/CD & Jenkins

20 minLesson 1 of 8

Learning Objectives

  • Understand CI/CD principles and benefits
  • Learn Jenkins architecture and components
  • Compare Jenkins with other CI/CD tools
  • Understand the DevOps pipeline lifecycle

What is CI/CD?

CI/CD is a set of practices that automate the process of integrating code changes, testing them, and delivering them to production.

The CI/CD Pipeline

┌──────┐   ┌───────┐   ┌──────┐   ┌────────┐   ┌──────────┐
│ Code │──▶│ Build │──▶│ Test │──▶│ Deploy │──▶│Production│
└──────┘   └───────┘   └──────┘   └────────┘   └──────────┘
    │                                                  │
    └──────────── Feedback Loop ───────────────────────┘

CI vs CD

ConceptFull NamePurpose
CIContinuous IntegrationMerge and test code frequently
CDContinuous DeliveryAutomate release to staging
CDContinuous DeploymentAuto-deploy to production

Why CI/CD?

  • Faster releases — Deploy multiple times per day
  • Fewer bugs — Catch issues early with automated tests
  • Reduced risk — Small, incremental changes are safer
  • Developer productivity — Less time on manual processes
  • Consistent quality — Every change goes through the same pipeline

What is Jenkins?

Jenkins is an open-source automation server that enables building, testing, and deploying software through pipelines.

Jenkins Key Features

  • Extensible — 1,800+ plugins for every tool and platform
  • Distributed — Master/agent architecture for scaling
  • Pipeline as Code — Define pipelines in Jenkinsfiles
  • Community — Massive community and ecosystem
  • Free — Open source, no licensing costs

Jenkins Architecture

┌─────────────────────────────────────┐
│          Jenkins Master              │
│  ┌─────────┐  ┌──────────────────┐  │
│  │ Web UI  │  │ Pipeline Engine  │  │
│  └─────────┘  └──────────────────┘  │
│  ┌─────────┐  ┌──────────────────┐  │
│  │Scheduler│  │ Plugin Manager   │  │
│  └─────────┘  └──────────────────┘  │
└────────┬────────────────┬───────────┘
         │                │
    ┌────▼────┐     ┌────▼────┐
    │ Agent 1 │     │ Agent 2 │
    │ (Linux) │     │(Docker) │
    └─────────┘     └─────────┘
ComponentRole
MasterOrchestrates pipelines, serves UI, manages agents
AgentsExecute build jobs (can be VMs, containers, bare metal)
ExecutorsThreads on agents that run jobs in parallel
PluginsExtend Jenkins functionality

CI/CD Tools Comparison

ToolTypeHostingPipeline Syntax
JenkinsSelf-hostedOn-premise/CloudGroovy (Jenkinsfile)
GitLab CIIntegratedSaaS/Self-hostedYAML
GitHub ActionsIntegratedSaaSYAML
CircleCISaaSCloudYAML
ArgoCDGitOpsKubernetesYAML

When to Choose Jenkins

  • Complex enterprise pipelines
  • On-premise requirements
  • Need maximum flexibility and plugins
  • Multi-platform builds (Linux, Windows, macOS)
  • Legacy system integration

The DevOps Pipeline

A typical Jenkins pipeline includes these stages:

1. Source    → Pull code from Git
2. Build     → Compile/package the application
3. Test      → Run unit, integration, and E2E tests
4. Analyze   → Code quality, security scanning
5. Package   → Build Docker image or artifact
6. Deploy    → Push to staging/production
7. Monitor   → Verify deployment health

Jenkins Terminology

TermDefinition
JobA single unit of work (build, test, deploy)
PipelineA series of connected jobs
StageA logical grouping within a pipeline
StepA single action within a stage
BuildOne execution of a job
WorkspaceDirectory where a job runs
ArtifactOutput files from a build
TriggerWhat starts a pipeline (push, schedule, manual)

Summary

You've learned:

  • CI/CD principles and the pipeline lifecycle
  • Jenkins architecture with master/agent model
  • How Jenkins compares to other CI/CD tools
  • Key Jenkins terminology
  • When Jenkins is the right choice

Next Steps

Next, we'll install Jenkins and configure it for your first pipeline.