Skip to content
Tutorials Center
My learning

Topics

Jenkins Tutorial

Learn Jenkins step by step: 40 lessons in 9 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Meet Jenkins

  1. 1 DevOps, the delivery lifecycle and where Jenkins fits Understand DevOps culture, the eight-phase lifecycle, continuous integration, delivery and deployment, infrastructure as code, DevSecOps and the metrics that show whether delivery improves.
  2. 2 What Is Jenkins? Learn what continuous integration and delivery are, what a CI server does, where Jenkins came from, how it compares with GitHub Actions and GitLab CI, and when to pick it.
  3. 3 Jenkins Architecture: Controller, Agents and Executors Understand how Jenkins is built: the controller, agents and executors, workspaces, the JENKINS_HOME folder, the build queue and the life of a build.
  4. 4 Installing Jenkins Install Jenkins with Docker, the WAR file, Linux packages or the Windows installer. Covers Java, ports, the first-run unlock, plugin setup and reverse proxies.
  5. 5 A Tour of the Jenkins Interface Find your way around Jenkins: the dashboard, views, job pages, build history, console output, Manage Jenkins, Blue Ocean versus the modern UI, and quick search.
  6. 6 Your First Job: Freestyle Projects Create your first Jenkins freestyle job: add a shell build step, run it, read the console output, understand build numbers and workspaces, and see its limits.

Pipeline as Code

  1. 7 Pipeline Basics and the Jenkinsfile Learn Jenkins Pipeline: what a Jenkinsfile is, declarative versus scripted syntax, and how pipeline, agent, stages and steps fit together in a first working pipeline.
  2. 8 Declarative Pipeline Syntax in Depth Learn every part of a declarative Jenkinsfile: agent, options, triggers, environment, tools, parameters, stages, post and when, plus the linter and common syntax errors.
  3. 9 Common Steps: sh, bat, echo, dir, withEnv Learn the Jenkins pipeline steps you use daily: sh and bat, returnStdout and returnStatus, dir, withEnv, timeout, retry, sleep, error and unstable, and shell quoting.
  4. 10 Stages, Parallel and Matrix Organise a Jenkins pipeline into sequential stages, run branches in parallel with failFast, expand a matrix of axes with excludes, and nest stages clearly.
  5. 11 Environment Variables and Parameters Use built-in variables like BUILD_NUMBER and GIT_COMMIT, the environment block, withEnv and build parameters, and learn which value wins when names collide.
  6. 12 Conditions and Post Actions Control which Jenkins stages run with when (branch, expression, changeset, allOf, anyOf, not) and react to results with post blocks, build results and cleanup.
  7. 13 Scripted Pipeline and Groovy for Jenkins Learn scripted Jenkins pipelines: node blocks, try/catch/finally, Groovy basics, closures, CPS limits, @NonCPS, the sandbox and script approval, and when to use script.

Source Control and Triggers

  1. 14 Checking Out Code with Git Learn how a Jenkins pipeline gets your code: checkout scm, the git step, branches, shallow clones, submodules, sparse checkout and clean workspaces.
  2. 15 Triggers: Webhooks, Polling and Schedules Choose how Jenkins builds start: GitHub and GitLab webhooks, SCM polling, cron with the H hash, upstream triggers, remote tokens and the quiet period.
  3. 16 Multibranch Pipelines and Pull Requests Let Jenkins discover branches, pull requests and tags by itself: branch sources, behaviors, organization folders, build strategies and orphaned item cleanup.

Build, Test and Package

  1. 17 Building Java, Node and Python Projects Build Java, Node.js and Python projects in Jenkins: the tools directive, Maven, Gradle, npm, pip with virtualenv, dependency caching and toolchains on agents.
  2. 18 Tests, JUnit Reports and Quality Gates Publish test results in Jenkins with the junit step, read trends, spot flaky tests, track coverage and warnings, and fail builds with quality gates.
  3. 19 Artifacts, Stash and Fingerprints Keep and move build output in Jenkins: archiveArtifacts, stash and unstash, copyArtifacts, fingerprints, artifact repositories and build retention.
  4. 20 Docker Agents and Building Images Run Jenkins stages inside Docker containers, build and push images from a pipeline, and understand the risks of the Docker socket and the safer alternatives.

Credentials, Plugins and Security

  1. 21 Credentials and Secrets Store passwords, tokens and SSH keys safely in Jenkins, use them with withCredentials, and learn how log masking works and where it stops protecting you.
  2. 22 Plugins: Finding, Managing and Pinning Find, install, update and pin Jenkins plugins. Understand dependencies, plugin-versions files, rollbacks, abandoned plugins and good plugin hygiene.
  3. 23 Security, Users and Authorization Secure Jenkins with security realms, matrix and role-based authorization, CSRF protection, safe agents, a locked-down script console and regular updates.

Scaling and Operating Jenkins

  1. 24 Agents, Labels and Scaling Connect SSH and inbound agents, route builds with labels, use cloud and Kubernetes ephemeral agents, size executors and throttle jobs as your Jenkins grows.
  2. 25 Shared Libraries Share pipeline code across repositories with Jenkins shared libraries: vars and src layout, global steps, @Library versions, folder libraries and testing.
  3. 26 Jenkins Configuration as Code (JCasC) Describe a whole Jenkins controller in a YAML file: jenkins.yaml, plugins baked into a Docker image, secrets from the environment, seed jobs and drift checks.
  4. 27 Backup, Monitoring and Troubleshooting Back up JENKINS_HOME, watch Jenkins with Prometheus and logs, and fix the usual trouble: full disks, stuck queues, hung builds, out-of-memory errors and slow UIs.
  5. 28 Administration recipes: ports, restarts, upgrades, CLI, plugins and Slack Practical Jenkins administration: change the port, restart safely, upgrade, recover a locked-out admin, reset a build number, list plugins with the CLI and send Slack notifications.

Deployment and Delivery

  1. 29 Deployment Pipelines and Approvals Build a Jenkins deployment pipeline with environments, input approvals, milestones, locks, rollback, release tags, notifications and artifact promotion.
  2. 30 Jenkins vs GitHub Actions, GitLab CI and Others Compare Jenkins with GitHub Actions and GitLab CI: model, hosting, cost, security and plugins, how to translate a Jenkinsfile, and how to choose a tool.
  3. 31 Jenkins vs TeamCity, Bamboo, Travis CI, Spinnaker, Maven and Kubernetes Compare Jenkins with TeamCity, Bamboo, Travis CI and Spinnaker, and clear up the common confusion between Jenkins and build tools like Maven or platforms like Kubernetes.
  4. 32 Deploying to Kubernetes from a Jenkins pipeline Build an image, push it and roll it out to Kubernetes from a Jenkinsfile with kubectl or Helm: credentials, rolling updates, smoke checks, rollback and a runnable rollout simulator.

Projects

  1. 33 Project: CI for a Java Application Build a complete Jenkins CI pipeline for a Maven project: build, JUnit reports, archived jar, multibranch setup and a quality gate, with a runnable stage simulator.
  2. 34 Project: Node App with Docker Build and Deploy Build a Jenkins pipeline for a Node app: npm tests, a tagged Docker image, a push to a registry and a production deploy stage behind an approval.
  3. 35 Project: A Monorepo Pipeline with Changed-Path Builds Build a Jenkins pipeline for a monorepo that only builds and tests the services whose files changed, runs them in parallel, reuses a shared library and caches dependencies.
  4. 36 Project: Build a Mini Jenkins Pipeline Engine Build a tiny declarative pipeline engine in JavaScript: tokenize and parse a Jenkinsfile-like text, run stages, parallel branches, retry, environment and post actions.

Practice and Review

  1. 37 Common Mistakes and Anti-Patterns Learn the Jenkins mistakes that cause slow, insecure and fragile CI: builds on the controller, secrets in logs, missing timeouts, giant Jenkinsfiles, and how to fix each one.
  2. 38 Practice Exercises with Solutions Practice Jenkins pipelines with five scenarios: test and archive, a build matrix, a parameterised deploy, failure notification and a cron schedule, with solutions explained.
  3. 39 Jenkins Interview Questions Prepare for a Jenkins interview with model answers on concepts, pipeline syntax, agents, security, scaling, troubleshooting and real scenario questions.
  4. 40 Jenkins Cheat Sheet A compact Jenkins cheat sheet: Jenkinsfile skeleton, directives, common steps, environment variables, cron syntax, URL and CLI tricks and a troubleshooting table.