Introduction to Jenkins
What is Jenkins and what are its use cases ?
What is Jenkins
Jenkins is an open-source automation server widely used for Continuous Integration and Continuous Delivery (CI/CD
). It automate the various stage of software development such as building, testing and deployement.
Jenkins is highly extensible through plugins, allowing integration with various tools and platforms. It supports distributed builds, enabling tasks to run across multiple machines.
Core Concepts
Understanding Jenkins involves exploring its key components that enable automation and orchestration in software development.
Jenkins Controller
The main node, known as the Jenkins Controller
, orchestrates the overall system. It manages the configuration, schedules jobs, loads plugins, and coordinates the workflow. The controller also manages connections to other nodes, called Jenkins Agents
, which handle the execution of build tasks. While the controller can run builds itself, it is more scalable and efficient to delegate these tasks to agents.
Jenkins Agents
Jenkins Agents
are separate nodes that connect to the Jenkins Controller to execute build jobs. Agents can run on physical or virtual machines, in containers, or in cloud environments. By distributing jobs across multiple agents, Jenkins can handle larger workloads, improve build performance, and isolate tasks for better security and reliability.
Jenkins Node
A Jenkins Node
is any machine Jenkins uses to run jobs, including both the Controller and Agents. Nodes execute builds and pipelines. Jenkins monitors node health and can take nodes offline if issues are detected.
Jenkins Projects
A Jenkins Project
is a configuration that defines automated tasks such as building, testing, or deploying software within Jenkins. Projects can be copied, renamed, or moved, making it easy to manage and reuse configurations as your automation needs evolve.
Jenkins Plugins
Jenkins Plugins
are community-developed modules that you can install on a Jenkins server to add features not available by default. You can easily install or upgrade plugins directly from the Jenkins dashboard.
Jenkins Pipeline
A Jenkins Pipeline
lets you define the sequence of steps for building, testing, and deploying applications in a Jenkinsfile
using a Groovy-based syntax. This enables version control, collaboration, and supports complex workflows for consistent and traceable automation in your software delivery process.
Use Cases
Jenkins is commonly used for:
Continuous Integration
: Automatically building and testing code when changes are made.Continuous Delivery
: Automating the deployment of applications to various environments.Automated Testing
: Running unit, integration, and acceptance tests as part of the pipeline.Monitoring and Reporting
: Tracking build status, test results, and deployment progress.
Installing Jenkins
To start using Jenkins, you need to install it on your system. Below are installation commands for popular platforms.
The Docker method is highly recommended for most users, as it provides an isolated, portable, and easy-to-manage Jenkins environment.
---
services:
jenkins:
image: jenkins/jenkins:lts
container_name: jenkins
ports:
- "8080:8080"
volumes:
- jenkins_home:/var/jenkins_home
environment:
JENKINS_OPTS: --httpPort=8080
volumes:
jenkins_home:
Uninstalling Jenkins
If you no longer need Jenkins or want to reinstall it cleanly, here is how to uninstall it depending on your platform.
docker compose down -v
docker rmi jenkins/jenkins:lts