Installation of Jenkins
Install Jenkins on Ubuntu 20.04
Step1:
Create Shell script file for installing jenkins
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
Step3:
Run the script file to installl it
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:
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:
We’ll click the Install suggested plugins option, which will immediately begin the installation process.
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.
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:
After confirming the appropriate information, click Save and Finish. You’ll receive a confirmation page confirming that “Jenkins is Ready!”: Click Start using Jenkins to visit the main Jenkins dashboard:
Plugins to be Installed:
Configure Systems Settings:
Jenkins server details For User name triggering in EMAIL:
Jenkins Shared Libs:
Select checkbox in Git parameter
Emailext Notification settings:
Using TLS:
Create one APP password in GMAIL and add it in jenkins credentials.
Using SSL:
Slack Integration:
Open slack:
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.
Step 2
Click on Manage Plugins and search for Slack Notification in the Available tab. Click the checkbox and install the plugin.
Step 3
After it's installed, click on Manage Jenkins again in the left navigation, and then go to Configure System. Find the Global Slack Notifier Settings section and add the following values:
Team Subdomain: <workspace name> (automatically generated in slack) Integration Token Credential ID: Create a secret text credential using 4E8YeWaQlkd69ipqumdUoLgjK as the value The other fields are optional. You can click on the question mark icons next to them for more information. Press Save when you're done.
Note: Please remember to replace the Integration Token in the screenshot below with your own. Step 4
For each Project that you would like receive notifications for, choose Configure from the project's menu.
Step 5
Then you'll need to add Slack Notifications to the Post-build Actions for this project.
Step 6
In the Slack Notifications section, choose the events you'd like to be notified about.
Expand
Copy token and add in the
Manage Jenkins > Manage Credentials> Add the token in the credentials Manage Jenkins > Configure system >
Sprint Deployment in Jenkins CI
Goto Jenkins using the ip xxx.xxx.12.7:8080
Login to Jenkins with given credentials
Select the Application ExpressTruckTax
To build the Jenkins CI of the Application refer this link Below,
Then Select ETT-CI
In Which Environment to build in Jenkins Select Sprint/Stage
Then Select ETT-ApiWeb or ETT-WIWO
Finally CI build success in the jenkins
After the CI-Build success Then run CD Build
Then Select Which Environment to Deploy the Build
Then Select CD-Sprint to Build the Application
Select Build with Parameters option in Jenkins Navigation Bar
Then fill the details to deploy the application in Sprint Environment.
Finally CD Build Deployed to Sprint Server
Same procedure for All Environments to Deploy the Applications.