DevOps Professional
DevOps Professional
JAVA DevOps
Pre-requisites:
Go to Jenkins URL in a new tab and login with the given credentials which will be available in the
table.
Open “Manage Jenkins” -> Scroll down and search for “Manage Plugins” -> Click on Advanced
tab.
Scroll down to Upload plugin option.
Click on Browse button to install the Jenkin plugins,
Click on Jenkins-Plugins folder. It consists of 3 sub folders.
Build-pipeline plugin
Deploy.hpi
Git.hpi
Upload the above mentioned 3 sub folders separately until everything will be success.
Open “Manage Jenkins” -> Scroll down and search for “Manage Plugins” -> Click on Available
tab.
You may need to download other plugins. Select the below plugins from Available tab and
“Install without Restart” option.
Note: Copy the plugin name one by one and paste it in the Filter search box and check the box
to select the plugin and click ->“Install without Restart” option.
Copy Artifact
Workspace cleanup
Cobertura
Folders
Artifactory
Junit
Tool Configurations to be done in Manage Plugin -> Global Tool Configuration.
Git: Set as /usr/bin/git in the git path(Leave Git name as Default)
JDK: Set the name to JDK and path to JDK as /usr/lib/jvm/java-8-openjdk-amd64
Maven: Create a New Maven Installation name it as MyMaven with the path pointing to
/opt/maven. Use this in the configuration of the pipeline while invoking Maven
targets(Uncheck Install Maven automatically).
Setting up Artifactory folder:
Step 1:
Go to Artifactory URL in a new tab and login with the given credentials which will be available in
the table.
From the admin option, under Repositories choose Local -> Create new repository using (+) New
option.
Create a local repository key on the JFrog server from Firefox with the folder name as
mentioned in the pom.xml of the project in eclipse, within the tag.
Create a New Local repository by clicking +New button present at the right corner.
Enter the Package type & Repository Key values as given below,
Package Type: Maven
Repository Key: Calc_Dev_Snapshot
Click Save and Finish.
Step 2:
To allow automated deployment to this repository through Jenkins pipeline, set the security
permission as mentioned next,
Click on Admin tab on the left and go to Permissions under Security option.
Select the Anything option.
Select the tab for Groups and click readers button and select on the Manage checkboxes
[Delete/Overwrite, Deploy/Cache, Annotated, Read] as mentioned in the screenshots.
Select the tab for Users and click anonymous button and select on the Manage checkboxes
[Delete/Overwrite, Deploy/Cache, Annotated, Read] as mentioned in the screenshots.
Check all the Checkboxes in Repository Actions and Build Actions for Groups and Users tab.
Click on Save and Finish.
Go to SonarQube URL in a new tab and login with the given credentials which will be available in
the table.
Note: If you are unable to see Log In button on top-right corner of the SonarQube Dashboard,
Zoom put browser window using CTRL (-).
Go to the Quality Profiles option.
Click on the Sonar Way present under the Java, 1 profile(s).
Click on Actions button present at the top right corner of the screen
Select Actions -> Copy and enter the New Quality profile name in the input box(New Name)
“___”(given in the question paper), and click copy button.
Make the newly created profile as Default one (By clicking Actions->Set as Default).
Finish.
Exercise 1:
Create a folder for Calculator Project build jobs. Within this, create the following Jobs as given below,
Setup
Compile
Static Analysis
UnitTest
Code Coverage
War
ToArtifactory
SmokeTest
Under this folder Folder (Central_CI_Pipeline), we have to create the Jobs as given below,
1) Setup
2) Compile
3) Static Analysis
4) UnitTest
5) Code Coverage
6) War
7) ToArtifactory
8) SmokeTest
Click on ´New Item´ in the Jenkins Home page.
Enter an item name (Setup) the text box.
Note: For All Jobs creation, we have to Choose Freestyle projects
Select the option as FreeStyleProject as shown below.
Then, Click on Ok option.
New Job will be created for SETUP.
Static Analysis
4) Unit Testing
Unit Testing
5) Code Coverage
6) War
ToArtifactory
SmokeTest
Note: Please click on Execute button to execute all the Jobs one by One. (Important)
To view the Test Cases Passed/ Failed, please click the “View Result” Button
Exercise:2 (6 Marks)
In Exercise 2 the above mentioned job “Unit Testing” should Fail, means it should display the
RED ball with thunder symbol.
Note: Please click on Execute button to execute all the Jobs one by One. (Important)
To view the Test Cases Passed/ Failed, please click the “View Result” Button.
Exercise:3 (9 Marks)
Go to SonarQube URL in a new tab and login with the given credentials which will be available in
the table.
Note: If you are unable to see Log In button on top-right corner of the SonarQube Dashboard,
Zoom put browser window using CTRL (-).
Go to the Quality Gates option.
Click on create button to create a new quality gate and give it a name.
CI_Calculator_Quality_Gate.
After that we need to set conditions for Minor Issues.
We need to set the limitation, if Warning is more than 5 and Error is more than 3.
In Exercise3 the above mentioned job “Static Analysis” should Fail, means it should display the
RED ball with thunder symbol.
Note: Please click on Execute button to execute all the Jobs one by One. (Important)
To view the Test Cases Passed/ Failed, please click the “View Result” Button.