</>

Technology

Jenkins

Difficulty

Beginner

Interview Question

What is Jenkins and why is it used in software development?

Answer

What is Jenkins?

Jenkins is an open-source Continuous Integration / Continuous Delivery (CI/CD) automation server written in Java. It helps teams automatically build, test, and deploy code every time a developer pushes changes.

Why Jenkins?

CODE
Developer pushes code → Git triggers Jenkins → Jenkins:
  1. Pulls latest code
  2. Compiles (Maven/Gradle/npm)
  3. Runs unit tests
  4. Runs automation tests (Selenium/Cypress)
  5. Builds artifact (JAR/Docker image)
  6. Deploys to staging/production
  7. Sends notification (email/Slack)

Key Features

  • āœ“Free & Open Source — large plugin ecosystem (1800+ plugins)
  • āœ“Pipeline as Code — Jenkinsfile (Groovy DSL) stored in Git
  • āœ“Distributed Builds — Master/Agent architecture for parallel execution
  • āœ“Integration — Git, GitHub, GitLab, Bitbucket, Maven, Docker, AWS, Kubernetes
  • āœ“Plugin Ecosystem — Slack, SonarQube, JaCoCo, Allure Reports, etc.
  • āœ“Scheduled Jobs — run builds via cron syntax
  • āœ“Parameterized Builds — pass variables to jobs (environment, browser, etc.)

Jenkins Architecture

CODE
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│                Jenkins Master                    │
│  - Schedules builds                             │
│  - Monitors agents                              │
│  - Manages plugins & config                     │
│                    │                            │
│        ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”                │
│        ↓           ↓           ↓                │
│   Agent 1      Agent 2     Agent 3              │
│   (Linux)      (Windows)   (Docker)             │
│   Run tests    Run tests   Build image          │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Jenkins vs GitHub Actions

FeatureJenkinsGitHub Actions
HostingSelf-hostedCloud (GitHub)
CostFree (self-host)Free tier + paid
SetupComplexSimple (YAML)
Plugin ecoHuge (1800+)Growing (marketplace)
ControlFullLimited
ScalingManual agentsAuto-scaled runners

Installation (Quick Start)

Bash
# Docker (easiest)
docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts

# Access at http://localhost:8080
# Initial password: docker logs <container-id>

Follow AutomateQA

Related Topics