Skip to main content

Command Palette

Search for a command to run...

What Is Jenkins and Why Every DevOps Engineer Needs to Understand CI/CD Pipelines

If you have been wondering what Jenkins actually does, or why DevOps engineers keep talking about CI/CD pipelines, this post is going to clear all of that up. We are going to start from the very beginning and build a solid mental model before touching a single command.

Updated
7 min read
What Is Jenkins and Why Every DevOps Engineer Needs to Understand CI/CD Pipelines
S
Passionate about Cloud and DevOps engineering. I write structured technical notes and beginner-friendly articles on AWS, Linux, CI/CD, networking, system architecture and modern software delivery workflows.

The Problem Jenkins Solves

Let us start with a story every developer knows.

A developer writes code, pushes it to GitHub, and then someone has to manually run mvn compile, mvn test, mvn package one by one to build the application. After that, someone has to manually check the code quality, manually upload the artifact to a storage location, and manually deploy it to a server.

Now imagine ten developers doing this every single day. You can see how quickly things become chaotic.

Jenkins exists precisely to eliminate this manual chaos. It is a tool that sits in the middle of all your other tools and automates the entire sequence from code commit to deployment.


What Is a Jenkins Job?

A Jenkins job is simply a task. Think of it as a set of instructions Jenkins follows whenever you tell it to run.

For a typical Java application, a Jenkins job might do this sequence:

  1. Pull the latest code from GitHub

  2. Run mvn compile to compile the source

  3. Run mvn test to execute the tests

  4. Run mvn package to generate a deployable artifact (a WAR file)

Previously, developers and DevOps engineers were running these Maven commands one by one, manually. Jenkins lets you define all of these steps once inside a job, and from that point forward you just hit a button (or Jenkins triggers it automatically) and everything happens on its own.

You can even replace those four separate Maven commands with a single command inside the job:

mvn clean package

Jenkins executes it, and the WAR file gets generated automatically in the Jenkins workspace.


Where Does Jenkins Store Its Files?

Jenkins has a default working directory. Whenever a job runs, all files including cloned repositories and generated artifacts live here:

/var/lib/jenkins/workspace

Inside this workspace directory, Jenkins creates a folder named after each job. So if your job is named my-app-build, the WAR file generated by Maven will land in:

/var/lib/jenkins/workspace/my-app-build/target/my-app.war

The target directory is created by Maven as part of the build process, and it always contains the final artifact.


The Full CI/CD Pipeline Architecture

Now that you understand what a Jenkins job is, let us zoom out and look at the bigger picture.

A complete CI/CD pipeline in a typical DevOps setup looks like this:

Code -> Build -> Test -> Artifact Storage -> Deploy

Here is how each stage maps to a real tool:

Stage Tool
Code GitHub (version control)
Build Maven (compiles Java, generates WAR)
Test / Code Quality SonarQube (code review, security scan)
Artifact Storage Nexus Repository or AWS S3
Deployment Tomcat (application server on EC2)

And sitting at the center of all of this, coordinating every stage? That is Jenkins.

Jenkins integrates with GitHub. Jenkins integrates with Maven. Jenkins integrates with SonarQube. Jenkins integrates with Nexus. Jenkins integrates with Tomcat on EC2. Jenkins can also integrate with Docker and Kubernetes.

Because Jenkins is constantly integrating all these tools and connecting them into a seamless automated workflow, it earns the name CI server - short for Continuous Integration server.


Understanding CI/CD: What Do Those Letters Actually Mean?

People throw these terms around constantly, so let us be precise.

Continuous Integration (CI)

This is the "build and test" part. Whenever a developer commits code to the repository, Jenkins automatically pulls that code, builds it, and tests it. No human needs to kick off the process manually.

Continuous Integration = Continuously building + continuously testing

Continuous Delivery (CD - Delivery)

When the build passes, the artifact is ready to be deployed. With continuous delivery, a human still makes the final decision to push the deployment. The pipeline delivers the artifact to a staging area, and a person clicks "deploy."

Continuous Deployment (CD - Deployment)

This is the fully automated version. When the build passes and all checks are green, Jenkins automatically deploys the application to the target environment without any human approval.

So the key distinction:

  • Continuous Delivery = manual deployment trigger

  • Continuous Deployment = automatic deployment, zero human involvement

Together, CI/CD is the automated highway that takes code from a developer's laptop to a running production server.


The Jenkins Pipeline Walkthrough

Let us trace exactly what happens when a developer pushes version 1 of their code to GitHub:

  1. The developer pushes version 1 code to GitHub.

  2. Jenkins detects the change (via a webhook or polling) and pulls the code.

  3. Jenkins runs Maven (mvn clean package) to compile the code and generate a WAR file.

  4. Jenkins sends the code to SonarQube for a quality and security scan.

  5. Jenkins stores the WAR file in Nexus or S3.

  6. Jenkins deploys the WAR file to a Tomcat server running on an EC2 instance.

Now the developer pushes version 2. The entire sequence above runs again, automatically. This is the continuous cycle. This is exactly what DevOps engineers get paid to set up, maintain, and improve.


Why Jenkins Over Everything Else?

Jenkins is open source and completely free. Most companies do not want to pay for proprietary CI tools when Jenkins handles the job perfectly well at no cost.

There are alternatives worth knowing about:

  • Bamboo (Atlassian, paid)

  • CircleCI (cloud-based)

  • GitHub Actions (built into GitHub)

  • GitLab CI/CD (built into GitLab)

  • Semaphore

  • Harness

  • Buddy

For Kubernetes deployments specifically, there is also ArgoCD, which is a dedicated GitOps deployment tool. ArgoCD is not a replacement for Jenkins - it is specialized for Kubernetes deployments and is often used alongside Jenkins in modern pipelines.

In AWS specifically, Amazon offers AWS CodePipeline as a managed CI/CD service. This is also worth learning, especially for cloud-native projects.

But in the vast majority of real-world companies that use self-hosted CI/CD, Jenkins is the standard choice.


Key Facts to Remember

Before moving on, lock these facts into your memory because they will come up constantly:

  • Jenkins default port: 8080

  • Jenkins default workspace path: /var/lib/jenkins/workspace

  • Jenkins requires Java to run - without Java installed, Jenkins will not start

  • Jenkins is open source - free to use

  • Jenkins was previously called Hudson - it was later forked and renamed

  • Plugins are central to Jenkins - Jenkins does not natively understand GitHub, Maven, Docker, or SonarQube. Every integration requires a plugin to be installed first.


What Gets Built on Top of This

Over the coming sections, you will learn to install Jenkins, create your first job, write pipelines using Groovy scripting, set up and integrate each of these tools (Tomcat, SonarQube, Nexus), and connect everything into a working end-to-end CI/CD pipeline.

The architecture diagram in your head should now look something like this:

Developer pushes code
         |
       GitHub
         |
       Jenkins  < The main orchestrator
      /  |  |  \
  Maven Sonar Nexus Tomcat/EC2

Jenkins is the brain. Every other tool in this pipeline is a muscle that Jenkins coordinates.


Summary

  • A Jenkins job is a task or a set of automated steps.

  • Jenkins sits at the center of a CI/CD pipeline and integrates with every tool in the software delivery lifecycle.

  • CI (Continuous Integration) means automatically building and testing code on every commit.

  • CD (Continuous Deployment) means automatically deploying successful builds to the target environment.

  • Jenkins is open source, runs on port 8080, requires Java, and extends its capabilities through plugins.

  • The typical pipeline flow is: GitHub -> Maven -> SonarQube -> Nexus/S3 -> Tomcat/EC2.

In the next post, we will install Jenkins on an Amazon Linux 2 EC2 instance.

More from this blog

Stop Writing Repetitive Playbooks: Ansible Tags, Variables, Loops, Handlers and Conditions Decoded

Once you have written your first few Ansible playbooks, installed some packages, and started a couple of services, a natural question comes up: what else can Ansible do? The answer is quite a lot. This article walks through six features that turn a basic Ansible setup into something genuinely powerful: the Setup module, Tags, Variables, Loops, Handlers, and Conditional tasks. Each one builds on what you already know, and together they give you the tools to manage complex, real-world server environments cleanly and efficiently. Before going further, the environment being used here has one Ansible master and multiple worker nodes. Two are grouped as prod and two as dev inside /etc/ansible/hosts. SSH key-based authentication is already configured between the master and all worker nodes. If any of that is not set up yet, revisit passwordless SSH setup and inventory configuration before continuing.

Jun 21, 202615 min read
Stop Writing Repetitive Playbooks: Ansible Tags, Variables, Loops, Handlers and Conditions Decoded

Ansible Playbooks Explained: From First YAML File to Managing Real Servers

If you have already run a few Ansible ad hoc commands and seen how they work, you already understand the core idea: one command, many servers. But ad hoc commands only take you so far. When you need to install software, start services, create users, copy files, and print confirmation messages, all in one automated run across multiple servers, that is when you move to playbooks. Playbooks are where Ansible truly earns its place in a DevOps workflow. Everything you do in Ansible at scale, you do through playbooks.

Jun 19, 202613 min read
Ansible Playbooks Explained: From First YAML File to Managing Real Servers

You Have 400 Servers to Configure. Now What? Let Ansible Do the Work.

Picture this. You have four EC2 instances running in your AWS account, and someone asks you to install Apache on all four of them. What do you do? The obvious answer most people go with is SSH into each machine, run the install command, repeat. Simple enough when it is four servers. But what happens when it is forty? Or four hundred? In a real enterprise environment, that number is not exaggerated at all. That is exactly the problem that Ansible was built to solve. And once you understand what it does and how it thinks, you will wonder how anyone managed large infrastructure without it.

Jun 18, 202612 min read
You Have 400 Servers to Configure. Now What? Let Ansible Do the Work.

Building Production-Ready Docker Deployments with Secrets, Stacks, and Distroless Images

This post wraps up the core Docker Swarm curriculum by covering four important topics that complete the picture of production-ready containerized deployments. We start with Docker Secrets, which solves the real-world problem of passing sensitive credentials into containers without hardcoding them. We then look at Docker Stack, which is how you run multi-service Docker Compose files across a Swarm cluster instead of a single host. After that we cover the distinction between replicated and global services, which is a concept that appears in Kubernetes as well. We close with a look at Portainer for those who prefer a visual interface, and a brief introduction to distroless images. Each of these topics builds on everything covered so far. If you have your Swarm cluster running, you can follow along with every command shown here.

Jun 17, 202614 min read
Building Production-Ready Docker Deployments with Secrets, Stacks, and Distroless Images

Beyond One Server: Solving Docker Scaling with Swarm and Container Networks

This post covers three separate but deeply connected topics. We start by finishing what was started with Docker Hub, pushing all four bank service images to a remote registry so they survive beyond any single machine. From there, we identify a real architectural problem with single-host Docker deployments and introduce Docker Swarm as the solution. Finally, we close with Docker networking, explaining how containers communicate with each other both on the same host and across different hosts. By the end of this article, you will understand how to push and pull images from Docker Hub, how to set up a multi-node Docker Swarm cluster, how to create and scale services across that cluster, what self-healing means in practice, and how Docker networking works under the hood.

Jun 17, 202618 min read
Beyond One Server: Solving Docker Scaling with Swarm and Container Networks
S

Sai Praneeth's Blogs

38 posts

From SDLC and Agile to DevOps and CI/CD, this blog is where I share structured technical notes, concepts and practical insights in Cloud and DevOps engineering.