Jenkins Basics

Unnati GuptaUnnati Gupta
3 min read

#90daysdevopschallenge

#day22

1.What is Jenkins?

Jenkins is an automation tool and it is an open-source server that allows developers to build, test, and deploy continuously of your application or software.

Jenkins is written in Java and runs in Java, to use this in your system, you have to install Java in your system.

To successfully achieve continuous integration in Jenkins, we used different types of plugins.

2. What is Plugins?

Plugins is a software program like GitHub used in Jenkins to achieve successful Continuous Installation.

3.Why do we use Plugins?

Jenkins already knows How to clone code from GitHub and run but to understand some other commands we need plugins.

4.History of Jenkins

In 2004, Kohsuke Kawaguchi, who was working as a JAVA developer in SUN Microsystem. He was getting tired of building, testing, and running pipelines daily to daily. So he developed a software called Hudson.

In 2011, Oracle who owned Sun Microsystems had a dispute with Hudson's open-source community, so they forked Hudson and renamed it as Jenkins.

5.Architecture of Jenkins

The architecture of Jenkins is based on master and slave architecture.

a) Jenkins Master node

b) Jenkins Slave node

By default, there is always one master node present and one slave node. You can add multiple slave nodes by using IP and ssh.

Jenkins Master Node:

The main server in Jenkins is called the Master node. It always runs on port 8080. It provides a dashboard, by using a dashboard you can create jobs but for build & test use a slave node.

Jenkins slave node:

By default, one slave node is present on Jenkins. if you want you can add multiple slave nodes. Jenkins slave executes jobs that are assigned by Jenkins master and you can assign the job to a particular slave node or the slave can choose any job.

How Jenkins works? Jenkins Architecture Explained!!! - DevOpsSchool.com

How Jenkins Works:

a) First of all developers commit the changes of code on GitHub, after a particular time Jenkins continuously checks for the update (By default in every 5s).

b) Whenever there is a new commit Jenkins finds it. Jenkins saves the changes is called workspace and starts to build changes.

c) If there is any error related to building, Jenkins informs the team and stops it there.

d) If the build is successful, then the Jenkins server deploys the built-in test server.

e) If testing is successful, the Jenkins server notifies to associated team.

โ„Tasks

1.Create a freestyle pipeline to print "Hello World!!

Step 1: Create an EC2 instance on AWS.

Step 2: Install Java on the EC2 instance.

sudo apt update
sudo apt install fontconfig openjdk-17-jre

Step 3: Install Jenkins on the EC2 Instance.

curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee \
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
  https://pkg.jenkins.io/debian binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins

Step 4: Get Initial Password

Step 5: Access it on the browser by using the public IP address of your EC2 Instance.

http://<public-ip-address>:8080

Step 6: Create a new job on Jenkins

Step 7: Enter the Name of the job. As per the task choose "Freestyle project".

Step 8: Choose "Build Steps"

Step 9: Enter your command <echo "Hello World!">. Click on "Apply".

Step 10: Click on "Build Now".

Step 11: Successfully Run

In the Next Article, we will read more about Jenkins......

Thank you for giving your precious time to read this blog/article and if any suggestions or improvements are required on my blogs feel free to connect on LinkedIn Unnati Gupta. Happy Learning !!!

10
Subscribe to my newsletter

Read articles from Unnati Gupta directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Unnati Gupta
Unnati Gupta

๐Ÿ‘จโ€๐Ÿ’ป DevOps Engineer at 6D Technology Passionate about bridging the gap between development and operations, I'm a dedicated DevOps Engineer at 6D Technology. With a strong belief in the power of automation, continuous integration, and continuous delivery, I thrive in optimizing software development pipelines for efficiency and reliability. ๐Ÿš€ Exploring the DevOps Universe In my articles, I delve into the fascinating world of DevOps, where I share insights, best practices, and real-world experiences. From containerization and orchestration to CI/CD pipelines and infrastructure as code, I'm here to demystify the complex and empower fellow developers and ops enthusiasts. ๐Ÿ“ Blogging for Knowledge Sharing As a tech enthusiast and a lifelong learner, I'm committed to sharing knowledge. My articles aim to simplify complex concepts and provide practical tips that help teams and individuals streamline their software delivery processes. ๐ŸŒ Connect with Me Let's connect and explore the ever-evolving landscape of DevOps together. Feel free to reach out, comment, or share your thoughts on my articles. Together, we can foster a culture of collaboration and innovation in the DevOps community. ๐Ÿ”— Social Links LinkedIn: https://www.linkedin.com/in/unnati-gupta-%F0%9F%87%AE%F0%9F%87%B3-a62563183/ GitHub: https://github.com/DevUnnati ๐Ÿ“ฉ Contact Have questions or looking to collaborate? You can reach me at unnatigupta527@gmail.com Happy Learning!!