Jenkins

·

3 min read

Day 23- More about Jenkins

Jenkins

Jenkins is an open-source automation server that is used for continuous integration and continuous delivery (CI/CD) of software projects. It provides a platform for automating the building, testing, and deployment of applications. Jenkins allows developers to integrate changes from different team members into a central repository, automatically build and test the code, and deploy it to production environments

Installation of Jenkins in the Ubuntu Machine

We need to update the package manager by using the following command

sudo apt update

Install Java on the Ubuntu Machine

sudo apt install openjdk-11-jre

Check the Java version(Verifying the Jenkins is installed or not)

java -version

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

curl -fsSL pkg.jenkins.io/debian-stable/jenkins.io-202.. | sudo tee
/usr/share/keyrings/jenkins-keyring.asc > /dev/null

Add the Jenkins repository to the package sources by running the following command:

echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]
pkg.jenkins.io/debian-stable binary/ | sudo tee
/etc/apt/sources.list.d/jenkins.list > /dev/null

Update your package manager again by running the following command:

sudo apt-get update

Install Jenkins by running the following command:

sudo apt-get install jenkins

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 the port 8080 so we need to open this port from the security group


You can Verify the status of the Jenkins

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://3.87.239.116:8080/

3. You will able to see Jenkins login screen

4. When you log in for the first time you will retrieve the administrator password in the login screen you will able to see the path copy and paste it on the EC2 instance

  1. After entering the password you should able to login into Jenkins

Task

Create a freestyle pipeline to print "Hello World"

Step 1- Click on the new item a page will display you need to enter the name of the project you want to create.

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

Step 3 - We need to add the Source Code management Details(Repoistery Link).

Step -4 If you want some triggers you can configure it

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

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

Step 7 - Click on the Console Output and check the Output

Thanks for Reading!!