// Automate everything.
MANUAL BUILDS ARE FOR AMATEURS.
Jenkins automates your software delivery pipeline. Every commit can trigger builds, tests, and deployments. Ship faster with confidence.
CI/CD IS NOT OPTIONAL.
In modern software development, continuous integration and delivery are essential. Jenkins is the open-source standard that powers thousands of deployments worldwide.
Click a lesson to begin
What is CI/CD? Jenkins overview and installation.
BeginnerCreate your first Jenkins job. Build a simple project.
BeginnerTrigger builds from Git commits. Webhooks.
BeginnerPoll SCM, timers, upstream jobs, and webhooks.
BeginnerJenkinsfile, scripted vs declarative pipelines.
IntermediateRun tests in pipeline. Test reporting.
IntermediateStore build outputs. Archive artifacts.
IntermediateParameterized builds. User inputs.
IntermediateAgents, nodes, and distributed execution.
AdvancedUser management, credentials, and permissions.
AdvancedExtend Jenkins. Popular plugins.
AdvancedPipeline patterns, scalability, and maintenance.
AdvancedJenkins is an open-source automation server for CI/CD. It automates building, testing, and deploying software.
# Install Java sudo apt update sudo apt install openjdk-11-jdk # Add Jenkins repo wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo tee /etc/apt/trusted.gpg.d/jenkins.asc echo "deb https://pkg.jenkins.io/debian binary/" | sudo tee /etc/apt/sources.list.d/jenkins.list sudo apt update sudo apt install jenkins # Start Jenkins sudo systemctl start jenkins sudo systemctl enable jenkins
Navigate to http://localhost:8080 and use the initial admin password.
1. What is Jenkins used for?
# Build step - Execute shell echo "Hello from Jenkins!" date whoami
1. What type of project is simplest?
# Public repo https://github.com/user/repo.git # Private repo (with credentials) git@github.com:user/repo.git # Specific branch */main */develop
1. Where do you configure Git in a job?
Check for changes at intervals:
# Check every 5 minutes H/5 * * * * # Check every 15 minutes H/15 * * * *
Schedule builds at specific times:
# Every day at midnight 0 0 * * * # Every Monday at 6am 0 6 * * 1
1. How often does H/5 * * * * check?
A pipeline is a workflow defined as code. It's versioned, reviewed, and more powerful than freestyle jobs.
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building...'
sh 'make'
}
}
stage('Test') {
steps {
echo 'Testing...'
sh 'make test'
}
}
stage('Deploy') {
steps {
echo 'Deploying...'
}
}
}
}
node {
stage('Build') {
echo 'Building...'
}
stage('Test') {
echo 'Testing...'
}
stage('Deploy') {
echo 'Deploying...'
}
}
Store your pipeline in a Jenkinsfile in your repository.
1. What file stores pipeline as code?
pipeline {
agent any
stages {
stage('Test') {
steps {
sh 'npm test'
}
post {
always {
junit 'reports/*.xml'
}
}
}
}
}
post {
always {
junit 'test-results/*.xml'
}
success {
echo 'Tests passed!'
}
failure {
echo 'Tests failed!'
}
}
1. What publishes JUnit test results?
Artifacts are build outputs that are preserved after the build completes.
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'make'
}
}
}
post {
always {
archiveArtifacts artifacts: 'build/**/*', fingerprint: true
}
}
}
Transfer files between stages or agents:
stage('Build') {
steps {
stash name: 'my-artifacts', includes: 'dist/**'
}
}
stage('Deploy') {
steps {
unstash 'my-artifacts'
}
}
1. What step saves files between stages?
Let users provide input when triggering builds.
parameters {
choice(name: 'ENV', choices: ['dev', 'staging', 'prod'], description: 'Deploy environment')
string(name: 'VERSION', defaultValue: '1.0.0', description: 'Version to deploy')
booleanParam(name: 'SKIP_TESTS', defaultValue: false, description: 'Skip tests?')
}
steps {
sh "./deploy.sh -e ${params.ENV} -v ${params.VERSION}"
}
1. What parameter creates a dropdown?
Scale your builds by adding more machines.
pipeline {
agent none
stages {
stage('Build on Linux') {
agent { label 'linux' }
steps {
echo 'Building on Linux'
}
}
stage('Build on Windows') {
agent { label 'windows' }
steps {
echo 'Building on Windows'
}
}
}
}
1. What runs builds on other machines?
pipeline {
options {
buildDiscarder(logRotator(numToKeepStr: '30'))
timeout(time: 1, unit: 'HOURS')
}
stages {
// your stages
}
}
1. Where are API keys stored?
Plugins add functionality to Jenkins.
// Kubernetes
podTemplate(...) {
node {
stage('Build') {
container('builder') {
sh 'make'
}
}
}
}
1. What adds Docker support?
You've completed the Jenkins Mastery guide. You now understand:
Jenkins is the most popular open-source automation server. It powers CI/CD at thousands of companies worldwide.
Whether you're a solo developer or part of a large team, Jenkins helps you ship faster with confidence.
Automate everything. Ship faster.