#90daysofdevops #22:Jenkins

#90daysofdevops #22:Jenkins

Just one click:Automation Begin

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.

  • Jenkins is a tool that is used for automation, and it is an open-source server that allows all the developers to build, test and deploy software. It works or runs on java as it is written in java. By using Jenkins we can make a continuous integration of projects(jobs) or end-to-endpoint automation.

  • Jenkins achieves Continuous Integration with the help of plugins. Plugins allow the integration of Various DevOps stages. If you want to integrate a particular tool, you need to install the plugins for that tool. For example Git, Maven 2 project, Amazon EC2, HTML publisher etc.

Jenkins is a software that allows continuous integration.

Continuous Integration:Continuous Integration is a development practice that requires developers to integrate code into a shared repository at regular intervals.

For Windows:

  1. Install Java Development Kit (JDK).

  2. Set the Path for the Environmental Variable for JDK.

  3. Download and Install Jenkins.

  4. Run Jenkins on Localhost 8080.

  5. Jenkins Server Interface.

  6. Build and Run a Job on Jenkins.

    Unlocking Jenkins for the first login - Hands-On Continuous Integration and  Delivery [Book]

Initial login page for Jenkins 2.141 (Windows) - Stack Overflow

For Linux Flavour:

Install Java :openjdk-11-jre

$ sudo apt update
$ sudo apt install openjdk-11-jre
$ java -version
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment (build 11.0.12+7-post-Debian-2)
OpenJDK 64-Bit Server VM (build 11.0.12+7-post-Debian-2, mixed mode, sharing)
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

Jenkins Features:

  • An extensible automation server, that helps with continuous integration and continuous delivery

  • Open source – great for anyone to start practicing with their own setup

  • Easy to install, set up and configure

  • Use it with thousands of plugins to enhance the usability of software applications

  • Can be used across platforms as it is coded in Java.

Create a freestyle pipeline to print "Hello World!!

  1. Install jenkins on AWS EC2 instance.

  2. For jenkins used port 8080, browse instance-public-IP/8080 it will open jenkins dashboard.

  3. Click on the "New Item" button on the left sidebar.

  4. Give your project a name, such as "demo-pipeline" and select "Freestyle project" as the project type.

    No alt text provided for this image

5. In the configuration section, scroll down to the "Build" section and add an "Execute shell" build step.

No alt text provided for this image

No alt text provided for this image

6. In the command field, enter the command to print "Hello World", such as echo "Hello World!!".

No alt text provided for this image

7. Click on the "Save" button at the bottom of the page to create the project.

8. Once the project is created, click on the "Build Now" link to run the project.

No alt text provided for this image

9.Read the Output as "Hello World!!!"