Skip to main content

Command Palette

Search for a command to run...

Learning Jenkins – Part 1

Published
3 min read

As part of my DevOps journey, I’ve started learning Jenkins, one of the most popular CI/CD tools.
I’ll be documenting my learnings in parts — both as a reference for myself and as a guide for others who are starting out.


Why Jenkins?

In modern development, teams can’t afford slow, manual deployment processes. Applications evolve daily, and every new feature or bug fix must be tested, built, and deployed reliably.

This is where CI/CD comes in:

  • Continuous Integration (CI)
    Developers frequently push code into a repository. Each commit triggers an automated process where the code is tested and built into artifacts. This ensures errors are caught early and integration issues are minimized.

  • Continuous Delivery (CD)
    The code is packaged and prepared for deployment. Deployments are still manual at this stage.

  • Continuous Deployment (CD)
    Deployments are fully automated. As soon as the code passes the pipeline, it goes live in production.

Together, CI/CD ensures speed, consistency, and reliability in software delivery.


CI/CD Flow

This simple flow shows how Jenkins automates code movement from developer → repo → build/test → deployment.


What is Jenkins?

Jenkins is an open-source CI/CD automation server.

With Jenkins, you can:

  • Automate code checkout from repositories (GitHub, GitLab, Bitbucket)

  • Automate build processes (.jar, .war, Docker images, etc.)

  • Perform code quality checks (SonarQube, linters, etc.)

  • Store build artifacts in repositories (Nexus, JFrog, AWS S3)

  • Deploy applications on Tomcat, Nginx, Docker, Kubernetes, and more

Key facts:

  • Runs on Java

  • Default port → 8080

  • Extensible with thousands of plugins


Jenkins Architecture

This high-level view shows how Jenkins connects developers, source control, build tools, artifact repositories, and deployment environments.


Jenkins Setup on Amazon Linux 2023

I set up Jenkins on an AWS EC2 instance running Amazon Linux 2023.

Steps:

sudo dnf update -y
sudo dnf install java-17-amazon-corretto-devel -y
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
sudo dnf install jenkins -y
sudo systemctl daemon-reload
sudo systemctl enable jenkins
sudo systemctl start jenkins
sudo systemctl status jenkins

Now, Jenkins is accessible at:
http://<EC2-Public-IP>:8080


Common Issue – Node Offline

On Amazon Linux 2023, /tmp is mounted in memory (tmpfs), which has limited space. Jenkins may show nodes as offline due to low disk space.

Fix: Move /tmp to EBS volume.

sudo mkdir /mnt/tmp
sudo chmod 1777 /mnt/tmp
sudo rsync -av /tmp/ /mnt/tmp/
echo "none /tmp tmpfs defaults,size=2G 0 0" | sudo tee -a /etc/fstab
sudo reboot

Jenkins Jobs

A Job in Jenkins = A task Jenkins executes.

Types of Jobs

  1. Freestyle Project – Configure via the Jenkins UI.

  2. Pipeline Project – Define jobs using scripts (Jenkinsfile).


My First Job in Jenkins

To test my setup, I created a Freestyle Job and added a simple build step:

echo "Hello from Jenkins"

Jenkins executed the job successfully, confirming my setup was working.


What’s Next?

This was just the start. In the next parts, I’ll explore:

  • Running custom shell scripts through Jenkins

  • Installing Apache via Jenkins jobs

  • Parameterized builds (String & Choice parameters)

  • Throttling builds (limit number of builds per hour)

  • Integrating GitHub repositories

  • Full pipeline: Checkout → Build → Deploy


Key Takeaways from Part 1

  • Jenkins is a must-know DevOps tool for CI/CD.

  • CI/CD saves time, reduces errors, and improves deployment speed.

  • Setup on EC2 is straightforward, but disk space issues need fixing.

  • Running the first Freestyle Job builds confidence in Jenkins usage.


This marks the beginning of my Jenkins learning series.
If you’re also exploring Jenkins, let’s connect — I’d love to hear how you’re approaching CI/CD in your projects.

👉 Next: Learning Jenkins – Part 2: Running Shell Scripts & Parameterized Jobs

More from this blog

Documenting My DevOps Journey

40 posts