Jenkins Pipeline Project 4
Jenkins Pipeline Project 4
1. E-mail Notification
Notification 1.4
System
Project
Snapshot
Project
Snapshot
Contact.java
Addressbook.java
Contactform.jav
a
ContactService.java
Delivery Pipeline for our
Project
Our project corresponds to scenario 4. Hence we will be building the delivery pipeline for our project as shown
below:
Develope Developer QA Unit Test QA
QA Package Deploy
r Code Case Metric
Compile Review Check
Where,
Build Job Description Plugin
Developer Compile Compiles the code pulled from GitHub repo NA
Review the compiled code to check whether the code meets
Developer Code Review PMD (Programming Mistake Detector)
the organization’s standard
QA Unit Test Perform unit test case JUnit
QA Metric Check Calculate the percentage of code accessed by testing Cobertura
QA Package Prepare a packaged code that can be deployed on any machine WAR build package
Deploy Specify the path to deploy the application NA
Each of the CI process in Jenkins for the above jobs will be discussed in the later sections of Module 2 and
Module 3
Configuring
pom.xml • To run a build, you need to specify its goal in the pom.xml file, present in GitHub
Repo
Let’s check the pom.xml file for the build jobs in our project:
Developer Compile
Developer Code The word specified in the <scope>
section should match with the job
Review QA Unit Test goal
QA Metric
Check QA
Package
Configuring
pom.xml Developer Code
Review
QA Unit Test
Developer Compile
Developer Code
Review QA Unit Test
QA Metric
Check QA
Package
For Developer Code Review, we use PMD (Programming The word specified in the <scope>
Mistake Detector) plugin. PMD is an inbuilt plugin in section should match with the job
Jenkins. Hence we do not specify its scope, instead we goal
provide its configuration details
Configuring
pom.xml QA Metric
Check
QA
Package
Developer Compile
Developer Code
Review QA Unit Test
QA Metric
Check QA
For QA Metric Check, we are using Cobertura plugin. For QA Package, maven sure fire plugin is responsible
Package Cobertura is an inbuilt plugin in Jenkins. Hence we do not for packaging the latest build that can be deployed on
specify its scope, instead we provide its configuration details any machine
Now we have
configured
the pom.xml file
Configure Test
Reports
Run Test Cases
Run Test Cases
Display
Display
Results
Results
Demo Run Build
Pipeline Step 4: Below screen shows the graphical representation of the build. Click on
run.
Configure Test
Reports
Run Test Cases
Run Test Cases Step 5: Your build starts
Display
Display executing
Results
Results
Demo Run Build
Pipeline Step 6: You can also see the console output by clicking on the highlighted
button
Configure Test
Reports
Run Test Cases
Run Test Cases
Display
Display
Results
Results
Demo Run Build
Pipeline Step 7: Once the build runs successfully, all the jobs in the delivery pipeline turns
green
Configure Test
Reports
Run Test Cases
Run Test Cases
Display
Display
Results
Results
Demo Display
Results Build Job Result
Developer Compile Compilation
Developer Code Review PMD Test Report
QA Unit Test Unit Test Case Report
QA Metric Check Cobertura Report
Activating Security
Identifying Jenkins
Users Authorization
Auditing
Identify Jenkins
Users • Delegate to servlet container:
• Used when you run Jenkins on a Servlet container such as Tomcat or
GlassFish
• Here you integrate the Servlet container with local enterprise user directory.
Activating Security • GitHub Authentication Plugin: Dedicated for GitHub users only
Activating Security
Identifying Jenkins
Users Authorization
Auditing
Authorizatio
n • Legacy mode
• Admin - Full control of the system
• Others - Only have the read
access.
• Matrix based security: Here, you can configure who can do what by using a
Activating Security big table.
Identifying Jenkins
Users Authorization
Auditing • Project based matrix authorization strategy
• First you provide access and then add users/groups for the
project.
Auditin
g • Jenkins also keeps track of the individual user actions: who did what to
server configuration.
Step 1: Install the audit trail plugin. The Audit Trail Plugin keeps track of the
main user actions in a set of rolling log files.
Activating Security
Identifying Jenkins
Users Authorization
Auditing
Auditin
g Step 2: Indicate the directory in which the log files are to be
written.
Activating Security
Identifying Jenkins
Users Authorization
Auditing
Notification
Management
E-mail Notification
E-mail
Notification
• The premium feature of the Jenkins server is to let people know when a build
breaks.
• Email notification is the most obvious and most common form of CI notification.
Slide 67