Learn Jenkins CI tutorial
Jenkins CI is the industry’s most popular, open-source tool for building continuous integration and continuous delivery (CI/CD) pipelines.
Any DevOps professional who wants to contribute meaningfully to their team needs to know the fundamentals of this powerful software deployment automation tool. That’s exactly what this Jenkins tutorial and crash course was designed to do.
Important Jenkins course topics
In this Jenkins crash course, you’ll go beyond the basics and learn:
- How to install Jenkins along with the appropriate JDK version
- How to create standalone and integrated Jenkins build jobs
- Create both basic and complex Jenkins pipelines
- Configure build parameters and access environment variables
- Install Jenkins plugins to access third-party functionality
- Integrate with GitHub, Maven, Gradle, Git and other tools
- Create Docker images with Jenkins
- Fully deploy a Spring Boot microservice into the cloud
Advanced Jenkins tutorial for expert users
While this Jenkins tutorial for beginners doesn’t miss a step between a basic install and the creation of complex pipelines, expert users will enjoy advanced aspects of this Jenkins tutorial which include:
- Configuring Jenkins credentials to authenticate against external tools and services
- Building a cloud-native Spring Boot application in Jenkins
- Packaging a microservice in an executable JAR file
- Invoking standard build jobs from scripted pipelines
- When to use shared Jenkins libraries in declarative pipelines
Jenkins download and install
To learn Jenkins, you must first install Jenkins.
The only Jenkins prerequisite is the installation of Java 11 or newer. In installation of Java 17 is recommended.
As of September 2023, support for Java 21 is not yet available, although it will be soon.
Jenkins can be installed on Windows through either the use of the .msi installer or it can be run as an executable JAR file.
The benefit of the .msi install is that Jenkins is configured as a service that runs at startup.
Jenkins pipelines and build jobs
After a developer installs Jenkins, the next step is to run a basic Hello World Jenkins build job. A single build step in a freestyle project is all that’s needed.
This Jenkins tutorial also builds a Hello World Jenkins pipeline immediately after the build job is created.
Importance of Jenkins pipelines
Many tutorials delay the introduction of the Groovy or Kotlin based Jenkins pipeline and instead concentrate on the GUI tools used to create standard build jobs. This Jenkins course does not make that mistake.
Pipelines and build jobs are given equal treatment in this course, with advanced Jenkins pipeline features being examined towards the end.
Jenkins environment variables and parameters
Two features commonly used when a developer creates a Jenkins build job are:
- Jenkins environment variables
- Parameterization at startup
This Jenkins course demonstrates both of these concepts, first by creating a parameterized build job, and then a pipeline that access environment variables in the Groovy code.
These exercises create a strong knowledge of important skills that DevOps engineers who work with Jenkins use every day.
Jenkins, GitHub, Maven and Gradle
With a strong knowledge of how Jenkins works, the next step is to integrate Jenkins with third party tools like:
- Git and GitHub for version control
- Apache Maven for dependency management
- Gradle for build and compile operations
The creation of a continuous integration pipeline that accesses a GitHub repo, builds and compiles the code with Maven and then packages the successfully saved binaries into a JAR file demonstrates a strong evolution of Jenkins skills and learning.
Its plugin architecture is what made Jenkins so popular.
Any vendor can make a Jenkins plugin that can be freely downloaded from a cloud-based marketplace.
This means simple Jenkins build jobs can be complimented with advanced tools that perform important operational tasks such as:
- Static code analysis
- Performance management
- Penetration testing
- Load testing
- Sending team notifications
- Stress testing
In the world of DevOps, the goal is always to shift left and embed operational tasks in the development phase.
For many teams engaging in a DevOps transition, the inclusion of Jenkins plugins in their builds is the first step in a gradual operational shift left.
Advanced Jenkins pipelines
The course finishes off with the development of a highly advanced Jenkins pipeline that:
- Pulls a Spring Boot microservice from GitHub
- Performs compile and test operations on the application
- Packages the microservice in an executable JAR file
- Builds a Docker image for deployment
- Uses credentials to authenticate over https
- Deploys the microservice into the cloud through DockerHub
A complete Jenkins course
From start to finish, this Jenkins tutorial for beginners will quickly turn novices into experts.
Continuous integration and deployment has never been so easy.