(Day 18) Task : Jenkins and CI/CD Pipeline Project Part 1 with Setup Environment :-


Welcome back to Day 18 of my #90DaysOfDevOps journey! Today, we are taking our first step into setting up a complete CI/CD pipeline using Jenkins. In this post, we’ll focus on preparing our local Mac environment by installing and configuring the key tools required: Java, Maven, Git, and Jenkins.
Why CI/CD and Jenkins?
CI/CD (Continuous Integration and Continuous Deployment) is the backbone of modern DevOps practices. Jenkins is one of the most widely used automation tools to implement CI/CD pipelines, making it an essential part of any DevOps toolkit.
Objectives of Part 1:
Install and verify Java (required for Jenkins and Maven).
Install Apache Maven for building Java applications.
Install Git for version control.
Install and set up Jenkins as a service.
Verify the entire environment is correctly configured.
Platform: macOS
We’re using macOS for this setup. Most of these tools are easily installed using Homebrew, a popular package manager for macOS.
Step 1 : Install Git
Git is essential for version control and integration with repositories like GitHub or GitLab.
Commands:
brew install git "Or" Download & Install git bash for mac
Verify & Config Git:
# verify:
git --version
# Config:
git config --global user.name "Aditya Sharma"
git config --global user.email "adityabrahman.1990@gmail.com"
# Listing:
git config --global --list
Step 2 : Install Java (OpenJDK)
Jenkins and Maven both require Java to run. Let’s install the latest version of OpenJDK 17.
Commands:
brew install openjdk@17 "Or" download latest armg64 dmg insaller for mac from oracle java
Configure Java:
After installation, link it properly:
# To find Path of file :
/usr/libexec/java_home -V
# Export path of JAVA_HOME in our bash(old devices filename)/Zsh(new devices filename)rcfile
# Open .zshrc file using "open .zshrc" & paste it inside the file :
export JAVA_HOME=$(/usr/libexec/java_home -v <version>)
export PATH=$JAVA_HOME/bin:$PATH
# To Load file into terminal:
source.zshrc
Verify & check java set or not :
# Verify:
java -version
# check java set or not:
echo $JAVA_HOME --> Gives Location of JAVA_HOME
Step 3 : Install Apache Maven
Maven is a build automation tool primarily used for Java projects.
Commands:
install maven
Configure Java:
After installation, link it properly:
# To find Path of file :
/usr/libexec/maven_home -V
# Open .zshrc file using "open .zshrc" & paste given below paths inside the file :
export MAVEN_HOME=$HOME/apache-maven-3.9.9
export PATH=$MAVEN_HOME/bin:$PATH
Verify Maven:
mvn -version
Step 4: Install Jenkins
Now that Java is ready, let’s install Jenkins.
Commands:
brew install jenkins-lts
Start Jenkins:
brew services start jenkins-lts
This will start Jenkins as a background service.
Check Jenkins Status:
brew services list
Access Jenkins:
Open your browser and go to:
localhost:8080
You’ll see the initial Jenkins setup page.
Final Setup in UI :
Install suggested plugins (recommended).
Create your admin user.
Configure Jenkins instance URL (use
http://localhost:8080
).Jenkins is ready to use!
What’s Next?
In Part 2, we’ll:
Connect Jenkins to GitHub.
Create a Maven-based Java project.
Build and test it using a Jenkins job.
Understand how to define a CI pipeline using a Jenkins file.
Subscribe to my newsletter
Read articles from Aditya Sharma directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Aditya Sharma
Aditya Sharma
DevOps Enthusiast | Python | Chef | Docker | GitHub | Linux | Shell Scripting | CI/CD & Cloud Learner | AWS