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
| Concept | Full Name | Purpose |
|---|---|---|
| CI | Continuous Integration | Merge and test code frequently |
| CD | Continuous Delivery | Automate release to staging |
| CD | Continuous Deployment | Auto-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) │
└─────────┘ └─────────┘
| Component | Role |
|---|---|
| Master | Orchestrates pipelines, serves UI, manages agents |
| Agents | Execute build jobs (can be VMs, containers, bare metal) |
| Executors | Threads on agents that run jobs in parallel |
| Plugins | Extend Jenkins functionality |
CI/CD Tools Comparison
| Tool | Type | Hosting | Pipeline Syntax |
|---|---|---|---|
| Jenkins | Self-hosted | On-premise/Cloud | Groovy (Jenkinsfile) |
| GitLab CI | Integrated | SaaS/Self-hosted | YAML |
| GitHub Actions | Integrated | SaaS | YAML |
| CircleCI | SaaS | Cloud | YAML |
| ArgoCD | GitOps | Kubernetes | YAML |
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
| Term | Definition |
|---|---|
| Job | A single unit of work (build, test, deploy) |
| Pipeline | A series of connected jobs |
| Stage | A logical grouping within a pipeline |
| Step | A single action within a stage |
| Build | One execution of a job |
| Workspace | Directory where a job runs |
| Artifact | Output files from a build |
| Trigger | What 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.