DevOps KT

icon picker
Jenkins

SO
Security Operations
Last edited 322 days ago by Ram Kumar

Installation of Jenkins

Install Jenkins on Ubuntu 20.04
Step1:
Create Shell script file for installing jenkins

vi install.sh
Enter the Installation script in the file.
#!/bin/bash

sudo apt install default-jre -y
java -version

sudo apt install default-jdk -y
javac -version

wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt update
sudo apt upgrade -y
sudo apt install jenkins -y
sudo apt upgrade -y
sudo systemctl start jenkins
sudo systemctl status jenkins
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Step2:
Give the permission for script file
chmod +x install.sh

Step3:
Run the script file to installl it
./install.sh

Setting up Jenkins

To set up your installation, visit Jenkins on its default port, 8080, using your server domain name or IP address: http://your_server_ip_or_domain:8080
You should receive the Unlock Jenkins screen, which displays the location of the initial password:
Unlock Jenkins screen
In the terminal window, use the cat command to display the password:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Copy the 32-character alphanumeric password from the terminal and paste it into the Administrator password field, then click Continue.
The next screen presents the option of installing suggested plugins or selecting specific plugins:
Customize Jenkins Screen
We’ll click the Install suggested plugins option, which will immediately begin the installation process.
Jenkins Getting Started Install Plugins Screen
When the installation is complete, you’ll be prompted to set up the first administrative user. It’s possible to skip this step and continue as admin using the initial password from above, but we’ll take a moment to create the user.
Note: The default Jenkins server is NOT encrypted, so the data submitted with this form is not protected. Refer to to protect user credentials and information about builds that are transmitted via the web interface.
Jenkins Create User
Enter the name and password for your user:
You’ll receive an Instance Configuration page that will ask you to confirm the preferred URL for your Jenkins instance. Confirm either the domain name for your server or your server’s IP address:
Jenkins Instance Configuration
After confirming the appropriate information, click Save and Finish. You’ll receive a confirmation page confirming that “Jenkins is Ready!”:
Jenkins is ready screen
Click Start using Jenkins to visit the main Jenkins dashboard:
Welcome to Jenkins Screen
Plugins to be Installed:
Configure Systems Settings:
Untitled.png
Jenkins server details
Untitled.png
For User name triggering in EMAIL:

Untitled.png
Jenkins Shared Libs:
pasted image 0.png
Select checkbox in Git parameter
Untitled.png
Emailext Notification settings:
Using TLS:
Create one APP password in GMAIL and add it in jenkins credentials.
Untitled.png

Using SSL:
Untitled.png
Slack Integration:
Open slack:
Select APPs
Untitled.png

Search and select
Untitled.png
Click configure
Add to slack
Untitled.png
Then follow below steps for integration in jenkins
Setup Instructions
Here are the steps necessary to add the Jenkins CI integration.
Note: These instructions are for v2.8. To install an older version, go down to Previous Setup Instructions.
Step 1
In your Jenkins dashboard, click on Manage Jenkins from the left navigation.
Untitled.png
Step 2
Click on Manage Plugins and search for Slack Notification in the Available tab. Click the checkbox and install the plugin.
Untitled.png
Step 3
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.