Day-22 : Getting Started with Jenkins

Introduction
With Linux, Git, GitHub, and Docker already covered, it's time to explore Jenkins, a powerful CI/CD automation tool that helps in deploying applications seamlessly.
What is Jenkins?
Jenkins is an open-source automation server written in Java that facilitates Continuous Integration (CI) and Continuous Deployment (CD) in the software development process. It automates building, testing, and deployment, making the DevOps pipeline more efficient.
Why Use Jenkins?
Automation: Reduces manual effort and human errors.
Continuous Integration: Ensures smooth code integration and testing.
Continuous Deployment: Automates release processes for faster and more reliable software delivery.
Extensibility: Supports various plugins for seamless integration with tools like Git, Docker, and AWS.
How Jenkins Fits into the DevOps Lifecycle
Jenkins plays a critical role in DevOps by automating repetitive tasks:
Build Stage: Fetches the latest code and compiles it.
Test Stage: Runs automated tests to identify bugs early.
Deploy Stage: Deploys the tested application to staging or production environments.
By implementing Jenkins in a CI/CD pipeline, organizations can release high-quality software at a faster pace.
Task 1: Write an Article on Jenkins
Below is a concise article covering the importance of Jenkins and how it integrates into DevOps.
Jenkins: The Backbone of CI/CD in DevOps
In today's fast-paced software development environment, automation is crucial. Jenkins is a leading tool that helps developers build, test, and deploy applications efficiently, ensuring faster and more reliable software delivery.
Why Jenkins?
Jenkins helps developers by automating repetitive tasks, such as:
Code Integration: Detects code changes, compiles, and integrates them seamlessly.
Automated Testing: Runs test cases to ensure software reliability.
Deployment: Pushes tested code to production environments with minimal manual intervention.
Extensive Plugin Support: Integrates with Git, Docker, Kubernetes, AWS, and more.
Jenkins in Action
Jenkins automates the build, test, and deployment process through pipelines. Developers push code to a repository (e.g., GitHub), Jenkins fetches it, runs tests, and if successful, deploys the software to the target environment.
With Jenkins, teams can achieve faster releases, improved code quality, and reduced deployment risks, making it a must-have tool in modern DevOps workflows.
Task 2: Create a Freestyle Pipeline to Print "Hello World"
Steps to Create a Freestyle Job in Jenkins
Login to Jenkins
Login with credentials
Create a New Job
Click on
New Item
Enter a name (e.g., "HelloWorldJob")
Select
Freestyle Project
and clickOK
Configure Build Steps
Scroll down to
Build
sectionClick
Add Build Step
โExecute Shell
Enter the following script:
echo "Hello World" echo "Current Date and Time: $(date)" git clone https://github.com/YOUR_GITHUB_REPO.git ls -la YOUR_GITHUB_REPO
Schedule the Job
Under
Build Triggers
, checkBuild periodically
Set the schedule as
H * * * *
(runs every hour)
Save & Build
Click
Save
Click
Build Now
to test
Check Console Output
Go to
Build History
โ Click on latest buildClick
Console Output
to verify results
Conclusion
Jenkins is an essential DevOps tool that automates the software delivery process, ensuring efficiency and speed. By following these steps, you have set up a basic Jenkins job. Next, explore Jenkins Pipelines and integrate it with Docker and Kubernetes for a complete CI/CD workflow.
Share Your Progress!
Post your learnings and screenshots on LinkedIn and tag #90DaysOfDevOps! ๐
Subscribe to my newsletter
Read articles from Shubhranshu Ransingh directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
