Skip to main content

Command Palette

Search for a command to run...

Getting Started with Jenkins 😃

Published
3 min read
S

I'm Suraj Barik Aspiring DevOps Engineer with Hands-on experience in Automating,Shell Scripting, Supporting in AWS, management, CI/CD, and DevOps processes.

What is Jenkins?

  • Jenkins is an open-source continuous integration-continuous delivery and deployment (CI/CD) automation software DevOps tool written in the Java programming language. It is used to implement CI/CD workflows, called pipelines.

Why did Jenkins come into the picture?

  1. Developers have to wait till the complete software is developed for the test results.

  2. If the test fails then locating and fixing bugs is very difficult. Developers have to check the entire source code of the software.

  3. The software delivery process was slow.

  4. Continuous feedback about things like coding or architectural issues, build failures, test status etc. was not present

Jenkins came into the picture to address the challenges in software development, such as repetitive tasks, manual interventions, and inconsistent build and deployment processes.Jenkins emerged as an open-source solution that offered developers a way to automate tasks, integrate different tools, and establish continuous integration and continuous delivery (CI/CD) pipelines. This helped teams achieve faster development cycles, better collaboration, and more reliable software releases.

📍Assessment:

📌Task 1:

Create an instance in ec2-server named as Jenkins-demo

Install Jenkins on your Ubuntu server

Follow the steps given at: https://www.jenkins.io/doc/book/installing/linux/

sudo apt-get update sudo apt
sudo apt install openjdk-17-jre
java -version

curl -fsSL https://pkg.jenkins.io/debian-stable/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-stable binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null

sudo apt-get update
sudo apt-get install jenkins

Install Java on the Ubuntu Machine

Import the Jenkins GPG key to verify the integrity of Jenkins packages by running the following command:

Start the Jenkins service by running the following command:

sudo systemctl start jenkins

#We can add Jenkins as a user
sudo usermod -aG jenkins $USER

By default, the Jenkins runs on port 8080 so we need to open this port from the security group

To access the Jenkins in your web browser

  1. Open any web browser.

2. Navigate to EC2 instances copy and public IP followed by port number.Eg-http://34.226.214.201:8080/login?from=%2F

3. You will able to see Jenkins login screen

  • Log in using the username admin and to get the initial admin password go to this location on your Jenkins server created on ec2 and run the command:
    sudo cd /var/lib/jenkins/secrets/initialAdminPassword

  • Copy the password and paste it to the URL page at the Administrator password options below

    Completion of Jenkins Configuration: Complete the setup wizard to personalize Jenkins, integrate recommended plugins, and establish an admin user.

    📌Task 2:

  • 👨‍💻Assigned Task: To craft a freestyle pipeline that prints "Hello World!!

Using the Jenkins dashboard, click Create New Item

We will be navigating to the next page we need to add the description of the project

In Build Steps you choose the option called "Execute Shell" option try to enter the command and click on the save button.

Now we will run our job and click on the Build Now option.

Boom🎇🎇✨Boom🎇🎇

The above task is just for beginners to understand the build process and pipelines through Jenkins and how Jenkins works.

Thank you for taking the time to read this blog. I hope you found the information helpful and insightful. So please keep yourself updated with my latest insights and articles on DevOps 🚀 by following me on:https://linuxenthusiast.hashnode.dev/

LinkedIn:https://www.linkedin.com/in/surajrider/

Happy learning 🚀😊

More from this blog

Suraj's Spark ☁️

32 posts