SlideShare a Scribd company logo
Jenkins CI
Ruchi Agarwal
Sr Software Consultant
Knoldus Software LLP
Index:

About Jenkins CI

Install Jenkins

Configure Jenkins Job (Git/ Assembla)

Schedule Jenkins job

Post Build Actions : Extended E-mail Notification

Web Hooks (Git/ Assembla)

Matrix-based Security
About Jenkins:
- Jenkins is an open source continuous integration (CI) tool written in Java.
Continuous integration (CI) is the practice, in software engineering, of merging all developer
working copies with a shared mainline several times a day. The main aim of CI is to prevent
integration problems
- Jenkins provides continuous integration services for software development. It is a server-
based system running in a servlet container such as Apache Tomcat.
- It supports SCM tools including AccuRev, CVS, Subversion, Git, Mercurial, Perforce,
Clearcase and RTC, and can execute Apache Ant and Apache Maven based projects as well as
arbitrary shell scripts and Windows batch commands.
- Builds can be started by various means, including being triggered by commit in a version
control system, scheduling via a cron-like mechanism, building when other builds have
completed, and by requesting a specific build URL.
Install Jenkins
- Download Jenkins.war file:
$ wget http://ftp-chi.osuosl.org/pub/jenkins/war/1.592/jenkins.war
- Run Jenkins:
$ java -jar jenkins.war
- By default, Jenkins listen on port 8080. Access this port with browser to start configuration
Command Line Parameters
- To change port numer:
$ java -jar jenkins.war --httpPort=$HTTP_PORT
- Binds Jenkins to the specific IP address (deafult is 0.0.0.0)
$ java -jar jenkins.war --httpListenAddress=$HTTP_HOST
- Runs Jenkins to include the $PREFIX at the end of the URL
$ java -jar jenkins.war --prefix=$PREFIX
Configure a Jenkins Job : Git and Assembla
- Under ‘Manage Jenkins’ -> ‘Manage Plugins’, select and install following plugins:
•
Github and Git plugins
•
Assembla and Assembla Auth Plugin
- Restart after finish the installation. After this is installed either create a new build or configure
an existing build job
- Add github repository path
-> In "Source Code Management" select "Git"
a) Provide Repository URL
b) Credentials of Repositories for private repository (login access/ SSH key)
c) Branch to build (i.e. branchName)
- Add a Build step to the Execute shell command. This gives the ability to define a bash script to
perform build execution
- Save changes and Run a build.
- Jenkins clone the project in its workspace and after that execute provided shell command
script
Schedule Jenkins Job
- Under “Configure” -> “Build trigger” give the time in cron syntax for triggering a job
automatically in Jenkins
Examples:
•
*/1 * * * * : Every minute
•
0 0 1 * * : Once in a day
•
0 0 * * 0 : Once in a week
•
0 0 * * * : Once in a day
Post Build Actions : Extended E-mail Notification
- Jenkins privides post build actions which executes after the jenkins build. Jenkins allows to
have email notification for successful or failed build.
- Install “Manage Jenkins” -> “Manage plugins” -> ”Email-ext plugin"
- Go to Manage Jenkins -> Configure System ->
a) In Jenkins Location provide "System Admin E-mail Address"
b) Extended E-mail Notification : Set up mail subject and contents settings
- In E-mail Notifications provide smtp mail server configuration
- Save the changes
- Go to Project Configuration -> Post Build Action -> Select "Editable E-mail Notifications"
- Provide email id of people in "Project recipients list", Attach Build Log (This document would
contain complete build report and would be attached with Email)
- In "Advanced Settings" option, Set "Triggers" to "Always". This would sent notifications for
every successful and failed build with complete logs.
- Save the changes
WebHook
A WebHook is an HTTP callback: an HTTP POST that occurs when something happens or a
simple event-notification via HTTP POST.
Build Jenkins Job on Git Commit
- With the latest Git plugin 1.1.14, can do this more easily by simply executing the following
command:
curl http://yourserver/jenkins/git/notifyCommit?url=<URL of the Git repository>
- This will scan all the jobs that’s configured to check out the specified URL, and if they are also
configured with polling, it’ll immediately trigger the polling (and if that finds a change worth a
build, a build will be triggered in turn.)
- Follow the follwoing steps to set-up:

Go to “Configure” -> “Build Trigger”

Check “Poll SCM” : Leave the schedule field empty

Now, go to “Settings” page of your github repository (http://github.com/
<user_id>/<project_name>/settings)

Search for “Jenkins (Git Plugin)” under “Webhooks & Services” -> “Services” -> “Add
services”

Provide Jenkins url. "Jenkins Url" is the base URL of Jenkins server

This willl hit /git/notifyCommit under github repository URL
- Add service and That's It
- Commit the changes. This will trigger jenkins job
WebHook with Assembla
- Add a Webhook tool via the Admin → Tools on the Assembla home screen (this action
requires to have admin rights)
- Create a new Webhook with the following options:
Title : ‘Jenkins Commit’ or any;
Authentication type: Basic;
External url: {IP address of your jenks server}/git/notifyCommit?url=%{repository_url};
Http metod: Get;
Content type – text/plain;
Leave the content field empty and tick ‘Code commits’ at ‘Post updates about’ section.
Matrix-based security
- Matrix-based security is one of the authorization strategies available for securing Jenkins.
- It allows to grant specific permissions to users and groups. Follow the following steps to
enable security:

Activate “Enable Security” under “Manage Jenkins” -> “Configure Global Security”

Select “Jenkins’ own user database” from “Security Realm” and activate jenkins sign up

Select “Matrix-based security” and set the permissions to user/ group
- Save changes
Jenkins CI

More Related Content

PPTX
PDF
Jenkins
PPT
Continuous Integration (Jenkins/Hudson)
PPTX
Jenkins CI
PPTX
Jenkins Introduction
PPTX
Introduction to Continuous Integration with Jenkins
PDF
Jenkins-CI
PPTX
Jenkins CI presentation
Jenkins
Continuous Integration (Jenkins/Hudson)
Jenkins CI
Jenkins Introduction
Introduction to Continuous Integration with Jenkins
Jenkins-CI
Jenkins CI presentation

What's hot (20)

PPTX
Supermondays: Jenkins CI lightning talk
KEY
Continuous Delivery Using Jenkins
PDF
Yale Jenkins Show and Tell
PDF
Jenkins CI
PPTX
JENKINS Training
PPTX
Continuous integration
PPTX
Continuous integration using jenkins
PPTX
Ci jenkins maven svn
PDF
Let’s start Continuous Integration with jenkins
PPT
Continuous integration
PDF
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
ODP
An Introduction To Jenkins
PPT
CI and CD with Jenkins
PPTX
Jenkins tutorial for beginners
PPTX
Introduction to jenkins
PPTX
Jenkins for java world
PDF
Hacking Jenkins
PDF
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
PPTX
Jenkins Pipeline 101 and TCI - presentation and workshop
PPTX
Continous integration with jenkins
Supermondays: Jenkins CI lightning talk
Continuous Delivery Using Jenkins
Yale Jenkins Show and Tell
Jenkins CI
JENKINS Training
Continuous integration
Continuous integration using jenkins
Ci jenkins maven svn
Let’s start Continuous Integration with jenkins
Continuous integration
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
An Introduction To Jenkins
CI and CD with Jenkins
Jenkins tutorial for beginners
Introduction to jenkins
Jenkins for java world
Hacking Jenkins
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
Jenkins Pipeline 101 and TCI - presentation and workshop
Continous integration with jenkins
Ad

Similar to Jenkins CI (20)

PDF
Continuous Integration using Jenkins with Python
PPTX
Drupal Continuous Integration with Jenkins - Deploy
PDF
OSDC 2017 | Automating Jenkins by Julien Pivotto
PDF
OSDC 2017 - Julien Pivotto - Automating Jenkins
PDF
Managing Jenkins with Python
PDF
Postman tests in jenkins
PPTX
Pipeline as code - new feature in Jenkins 2
PPTX
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
PDF
Dev Ops
PDF
Why so continuous
PDF
Basic Rails Training
PDF
Jenkins Tutorial.pdf
PDF
How to Install and Configure Jenkins on Centos 7
PDF
Priming Your Teams For Microservice Deployment to the Cloud
PPT
Continuos integration for iOS projects
PPTX
Deploying windows containers with kubernetes
PDF
DevOps_project.pdf
PDF
Web works hol
PDF
Docker and Puppet for Continuous Integration
PPTX
Continuous Integration Step by Step
Continuous Integration using Jenkins with Python
Drupal Continuous Integration with Jenkins - Deploy
OSDC 2017 | Automating Jenkins by Julien Pivotto
OSDC 2017 - Julien Pivotto - Automating Jenkins
Managing Jenkins with Python
Postman tests in jenkins
Pipeline as code - new feature in Jenkins 2
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
Dev Ops
Why so continuous
Basic Rails Training
Jenkins Tutorial.pdf
How to Install and Configure Jenkins on Centos 7
Priming Your Teams For Microservice Deployment to the Cloud
Continuos integration for iOS projects
Deploying windows containers with kubernetes
DevOps_project.pdf
Web works hol
Docker and Puppet for Continuous Integration
Continuous Integration Step by Step
Ad

More from Knoldus Inc. (20)

PPTX
Angular Hydration Presentation (FrontEnd)
PPTX
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
PPTX
Self-Healing Test Automation Framework - Healenium
PPTX
Kanban Metrics Presentation (Project Management)
PPTX
Java 17 features and implementation.pptx
PPTX
Chaos Mesh Introducing Chaos in Kubernetes
PPTX
GraalVM - A Step Ahead of JVM Presentation
PPTX
Nomad by HashiCorp Presentation (DevOps)
PPTX
Nomad by HashiCorp Presentation (DevOps)
PPTX
DAPR - Distributed Application Runtime Presentation
PPTX
Introduction to Azure Virtual WAN Presentation
PPTX
Introduction to Argo Rollouts Presentation
PPTX
Intro to Azure Container App Presentation
PPTX
Insights Unveiled Test Reporting and Observability Excellence
PPTX
Introduction to Splunk Presentation (DevOps)
PPTX
Code Camp - Data Profiling and Quality Analysis Framework
PPTX
AWS: Messaging Services in AWS Presentation
PPTX
Amazon Cognito: A Primer on Authentication and Authorization
PPTX
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
PPTX
Managing State & HTTP Requests In Ionic.
Angular Hydration Presentation (FrontEnd)
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Self-Healing Test Automation Framework - Healenium
Kanban Metrics Presentation (Project Management)
Java 17 features and implementation.pptx
Chaos Mesh Introducing Chaos in Kubernetes
GraalVM - A Step Ahead of JVM Presentation
Nomad by HashiCorp Presentation (DevOps)
Nomad by HashiCorp Presentation (DevOps)
DAPR - Distributed Application Runtime Presentation
Introduction to Azure Virtual WAN Presentation
Introduction to Argo Rollouts Presentation
Intro to Azure Container App Presentation
Insights Unveiled Test Reporting and Observability Excellence
Introduction to Splunk Presentation (DevOps)
Code Camp - Data Profiling and Quality Analysis Framework
AWS: Messaging Services in AWS Presentation
Amazon Cognito: A Primer on Authentication and Authorization
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
Managing State & HTTP Requests In Ionic.

Recently uploaded (20)

PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Electronic commerce courselecture one. Pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
Big Data Technologies - Introduction.pptx
PDF
Modernizing your data center with Dell and AMD
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Machine learning based COVID-19 study performance prediction
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Electronic commerce courselecture one. Pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Big Data Technologies - Introduction.pptx
Modernizing your data center with Dell and AMD
The Rise and Fall of 3GPP – Time for a Sabbatical?
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Chapter 3 Spatial Domain Image Processing.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Digital-Transformation-Roadmap-for-Companies.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
NewMind AI Monthly Chronicles - July 2025
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Network Security Unit 5.pdf for BCA BBA.
Diabetes mellitus diagnosis method based random forest with bat algorithm
Agricultural_Statistics_at_a_Glance_2022_0.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Machine learning based COVID-19 study performance prediction

Jenkins CI

  • 1. Jenkins CI Ruchi Agarwal Sr Software Consultant Knoldus Software LLP
  • 2. Index:  About Jenkins CI  Install Jenkins  Configure Jenkins Job (Git/ Assembla)  Schedule Jenkins job  Post Build Actions : Extended E-mail Notification  Web Hooks (Git/ Assembla)  Matrix-based Security
  • 3. About Jenkins: - Jenkins is an open source continuous integration (CI) tool written in Java. Continuous integration (CI) is the practice, in software engineering, of merging all developer working copies with a shared mainline several times a day. The main aim of CI is to prevent integration problems - Jenkins provides continuous integration services for software development. It is a server- based system running in a servlet container such as Apache Tomcat. - It supports SCM tools including AccuRev, CVS, Subversion, Git, Mercurial, Perforce, Clearcase and RTC, and can execute Apache Ant and Apache Maven based projects as well as arbitrary shell scripts and Windows batch commands. - Builds can be started by various means, including being triggered by commit in a version control system, scheduling via a cron-like mechanism, building when other builds have completed, and by requesting a specific build URL.
  • 4. Install Jenkins - Download Jenkins.war file: $ wget http://ftp-chi.osuosl.org/pub/jenkins/war/1.592/jenkins.war - Run Jenkins: $ java -jar jenkins.war - By default, Jenkins listen on port 8080. Access this port with browser to start configuration Command Line Parameters - To change port numer: $ java -jar jenkins.war --httpPort=$HTTP_PORT - Binds Jenkins to the specific IP address (deafult is 0.0.0.0) $ java -jar jenkins.war --httpListenAddress=$HTTP_HOST - Runs Jenkins to include the $PREFIX at the end of the URL $ java -jar jenkins.war --prefix=$PREFIX
  • 5. Configure a Jenkins Job : Git and Assembla - Under ‘Manage Jenkins’ -> ‘Manage Plugins’, select and install following plugins: • Github and Git plugins • Assembla and Assembla Auth Plugin - Restart after finish the installation. After this is installed either create a new build or configure an existing build job - Add github repository path -> In "Source Code Management" select "Git" a) Provide Repository URL b) Credentials of Repositories for private repository (login access/ SSH key) c) Branch to build (i.e. branchName)
  • 6. - Add a Build step to the Execute shell command. This gives the ability to define a bash script to perform build execution - Save changes and Run a build. - Jenkins clone the project in its workspace and after that execute provided shell command script
  • 7. Schedule Jenkins Job - Under “Configure” -> “Build trigger” give the time in cron syntax for triggering a job automatically in Jenkins Examples: • */1 * * * * : Every minute • 0 0 1 * * : Once in a day • 0 0 * * 0 : Once in a week • 0 0 * * * : Once in a day
  • 8. Post Build Actions : Extended E-mail Notification - Jenkins privides post build actions which executes after the jenkins build. Jenkins allows to have email notification for successful or failed build. - Install “Manage Jenkins” -> “Manage plugins” -> ”Email-ext plugin" - Go to Manage Jenkins -> Configure System -> a) In Jenkins Location provide "System Admin E-mail Address" b) Extended E-mail Notification : Set up mail subject and contents settings
  • 9. - In E-mail Notifications provide smtp mail server configuration - Save the changes - Go to Project Configuration -> Post Build Action -> Select "Editable E-mail Notifications" - Provide email id of people in "Project recipients list", Attach Build Log (This document would contain complete build report and would be attached with Email) - In "Advanced Settings" option, Set "Triggers" to "Always". This would sent notifications for every successful and failed build with complete logs. - Save the changes
  • 10. WebHook A WebHook is an HTTP callback: an HTTP POST that occurs when something happens or a simple event-notification via HTTP POST. Build Jenkins Job on Git Commit - With the latest Git plugin 1.1.14, can do this more easily by simply executing the following command: curl http://yourserver/jenkins/git/notifyCommit?url=<URL of the Git repository> - This will scan all the jobs that’s configured to check out the specified URL, and if they are also configured with polling, it’ll immediately trigger the polling (and if that finds a change worth a build, a build will be triggered in turn.) - Follow the follwoing steps to set-up:  Go to “Configure” -> “Build Trigger”  Check “Poll SCM” : Leave the schedule field empty  Now, go to “Settings” page of your github repository (http://github.com/ <user_id>/<project_name>/settings)  Search for “Jenkins (Git Plugin)” under “Webhooks & Services” -> “Services” -> “Add services”
  • 11.  Provide Jenkins url. "Jenkins Url" is the base URL of Jenkins server  This willl hit /git/notifyCommit under github repository URL - Add service and That's It - Commit the changes. This will trigger jenkins job
  • 12. WebHook with Assembla - Add a Webhook tool via the Admin → Tools on the Assembla home screen (this action requires to have admin rights) - Create a new Webhook with the following options: Title : ‘Jenkins Commit’ or any; Authentication type: Basic; External url: {IP address of your jenks server}/git/notifyCommit?url=%{repository_url}; Http metod: Get; Content type – text/plain; Leave the content field empty and tick ‘Code commits’ at ‘Post updates about’ section.
  • 13. Matrix-based security - Matrix-based security is one of the authorization strategies available for securing Jenkins. - It allows to grant specific permissions to users and groups. Follow the following steps to enable security:  Activate “Enable Security” under “Manage Jenkins” -> “Configure Global Security”  Select “Jenkins’ own user database” from “Security Realm” and activate jenkins sign up
  • 14.  Select “Matrix-based security” and set the permissions to user/ group - Save changes