SlideShare a Scribd company logo
CI/CD Workflows and Best
Practices
with Jenkins
Kenichi Shibata
Why CI/CD
 It is important to have a stable code which runs all the time for deployment CI/CD is necessary
 If you want the code to be stable then you have to build it each time you push a new commit
 Building code takes time and adds overhead for the developers. Instead of running the builds
manually developers should focus on the code development.
 Jenkins is a good platform to build CI/CD
What is Jenkins?
 Jenkins helps to automate the non-human part of the whole software development process,
 Builds can be triggered by various means, for example by commit in a version control system, by
scheduling via a cron-like mechanism and by requesting a specific build URL. It can also be
triggered after the other builds in the queue have completed.
 Jenkins functionality can be extended with plugins.
 (from https://en.wikipedia.org/wiki/Jenkins_(software))
Good Continuous Integration
 Should be integrated with SCM such as Github/Bitbucket/Gitlab
 Should run all tests defined in the code
 Should send a feedback to the developers. Preferably a less disctracting means such as chat
system instead of emails. (e.g. slack, hipchat, hangouts)
Types of CI
 Pull Request CI
 The checks are run against the fork or the branch of the being compared against the base branch
 Nightly Batch CI
 The checks are being run on the base branch when no one is working on it i.e. nightly
 Poll changes SCM CI
 The checks are done each time something changes in the SCM (not recommended especially in big teams)
 Branch merge CI
 The checks are ran and then built then merged to another branch. E.g. Building a lib branch or a release branch
with Binaries
 Regression Based CI
 The comprehensive checks are done against a branch usually production branch before deployment
CI (cont)
 It is recommended to have a code review mechanism before you merge your code to the
common branch in your workflow (i.e. master, staging, production, v1)
 The code review mechanism should come in two parts,
 Automated Review (CI)
 Manual Review (PR Review)
 It is recommended therefore to have a Pull Request CI before code merge and before
deployment there should be a Regression Based CI
Sample Basic CI/CD (Good for small teams)
PR to
Staging
Automated
Review (PR
CI)
Manual
Review
Merge to
Production
Run
regression
CI
Deployment
Simple Deployment workflow
Sample Agile Team Workflow
PR
Reviews
Deployment to
Integration
Multi PRs
Regression
Deploy to
Do demo every sprint demo and deploy multi prs depending on tickets which are assigned on the Sprint
Sample Advanced CI Workflow (good for big teams)
Pull Request
Manual
Reviews
Automated Reviews
UI and Unit Tests
Nightly Batch CI
Deployment to
developer’s
Environment
Manual QA
QA Team Rejects
Or Accepts
QA Creates PR
Regression Test
Production
Deployment
Needs Disposable Infrastructure for Developer’s Environment
How to Configure Jenkins
 Best Practices
 There should be a jenkins which is designated for CI/CD use having a multipurpose jenkins is not
recommended and critical batch jobs should not use the same resources as CI/CD
 Use a separate user with its home directory jenkins is not a good user
 Use small master and use master-slaves setup with majority of the workload in the slaves
 Use Secure Authentication Tokens or better yet SSH Keys in configuring SCM access (need to deploy
public keys on github)
 Don’t use username:password
 Use LDAP authentication for more secure access
 Keep your jenkins inside vpn (this could cause issues if git SCM is trying to send webhooks)
 If you use above setup have a secure publicly accessible NGINX proxy server to pass the payload to your jenkins
inside VPN (small instance or reuse an instance will work)
Useful Plugins
 https://github.com/janinko/ghprb (pull request builder)
 https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin (git access)
 https://wiki.jenkins-ci.org/display/JENKINS/Simple+Theme+Plugin (readability)
 (use this one to make your jenkins logs more readable go to Manage-Jenkins -> configure system -> themes
 https://cdnjs.cloudflare.com/ajax/libs/doony/1.6/css/doony.min.css for css
 https://cdnjs.cloudflare.com/ajax/libs/doony/1.6/js/doony.min.js for JS
 https://wiki.jenkins-ci.org/display/JENKINS/Rebuild+Plugin (rebuilding)
 https://wiki.jenkins-ci.org/display/JENKINS/AnsiColor+Plugin (readability)
 https://wiki.jenkins-ci.org/display/JENKINS/LDAP+Plugin (LDAP security)
 https://wiki.jenkins-ci.org/display/JENKINS/Matrix+Authorization+Strategy+Plugin (security)
 https://wiki.jenkins-ci.org/display/JENKINS/Multijob+Plugin (upstreaming and downstreaming jobs)
 https://wiki.jenkins-ci.org/display/JENKINS/Slack+Plugin (slack notification)

More Related Content

PDF
Jenkins Best Practices Meetup Slides
PDF
Jenkins Best Practices
PPT
Continuous Integration (Jenkins/Hudson)
ODP
7 Habits of Highly Effective Jenkins Users
PDF
Let’s start Continuous Integration with jenkins
PPT
Jenkins CI
PDF
Using Docker for Testing
PPTX
Supermondays: Jenkins CI lightning talk
Jenkins Best Practices Meetup Slides
Jenkins Best Practices
Continuous Integration (Jenkins/Hudson)
7 Habits of Highly Effective Jenkins Users
Let’s start Continuous Integration with jenkins
Jenkins CI
Using Docker for Testing
Supermondays: Jenkins CI lightning talk

What's hot (20)

PDF
Jenkins
PDF
CI is dead, long live CI
PPTX
Introduction to jenkins
PDF
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
PPTX
PPTX
Introduction to Continuous Integration with Jenkins
PDF
Using CI for continuous delivery Part 1
PPTX
Jenkins CI
PDF
Jenkins-CI
PPTX
SD DevOps Meet-up - Jenkins 2.0 and Pipeline-as-Code
PDF
Android + jenkins
PDF
Git and GitHub for Documentation
PDF
Jenkins CI
KEY
Continuous Delivery Using Jenkins
PDF
Dockercon2015 bamboo
PPT
CI and CD with Jenkins
PPTX
Jenkins tutorial
PPTX
Jenkins Introduction
PDF
Yale Jenkins Show and Tell
PPTX
Jenkins for java world
Jenkins
CI is dead, long live CI
Introduction to jenkins
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
Introduction to Continuous Integration with Jenkins
Using CI for continuous delivery Part 1
Jenkins CI
Jenkins-CI
SD DevOps Meet-up - Jenkins 2.0 and Pipeline-as-Code
Android + jenkins
Git and GitHub for Documentation
Jenkins CI
Continuous Delivery Using Jenkins
Dockercon2015 bamboo
CI and CD with Jenkins
Jenkins tutorial
Jenkins Introduction
Yale Jenkins Show and Tell
Jenkins for java world
Ad

Similar to Jenkins workflows and Best Practices (20)

PDF
JUC Europe 2015: Optimizing Your CI: Lessons Learned from a Successful Jenkin...
PPTX
Optimizing Your CI: Lessons Learned from a Successful Jenkins Rebuild - JUC U...
PPTX
Optimizing Your CI: Lessons Learned from a Successful Jenkins Rebuild - JUC U...
PPT
Jenkins Overview
PPTX
The Key Components of Adopting CI The OpenStack Way
PPTX
Continuous Integration as a Way of Life
PDF
Continuous Integration using Jenkins with Python
PDF
Using Jenkins as your go-to CI/CD tool
PPTX
Lets talk about CI CD Pipeline in Agile
PDF
How to plan and define your CI-CD pipeline
PDF
Continuous Deployment Applied at MyHeritage
PPTX
Michigan IT Symposium 2017 - CI/CD Workflow Tutorial
PPTX
DevOps-CI_CD_JAVA_JAVA______Jenkins.pptx
PPTX
Ordina Accelerator program 2019 - Jenkins blue ocean pipelines
PPTX
introductiontocicdknolx-220210084710.pptx
PDF
Introduction to CICD
PDF
Atlanta Jenkins Area Meetup October 22nd 2015
PDF
Jenkins - Automating Yourself Out Of A Job (One That You Don't Want)
PDF
What is GitOps? How GitOps works? we discuss Key Challanges.
PDF
What is GitOps? How GitOps works? we discuss Key Challanges.
JUC Europe 2015: Optimizing Your CI: Lessons Learned from a Successful Jenkin...
Optimizing Your CI: Lessons Learned from a Successful Jenkins Rebuild - JUC U...
Optimizing Your CI: Lessons Learned from a Successful Jenkins Rebuild - JUC U...
Jenkins Overview
The Key Components of Adopting CI The OpenStack Way
Continuous Integration as a Way of Life
Continuous Integration using Jenkins with Python
Using Jenkins as your go-to CI/CD tool
Lets talk about CI CD Pipeline in Agile
How to plan and define your CI-CD pipeline
Continuous Deployment Applied at MyHeritage
Michigan IT Symposium 2017 - CI/CD Workflow Tutorial
DevOps-CI_CD_JAVA_JAVA______Jenkins.pptx
Ordina Accelerator program 2019 - Jenkins blue ocean pipelines
introductiontocicdknolx-220210084710.pptx
Introduction to CICD
Atlanta Jenkins Area Meetup October 22nd 2015
Jenkins - Automating Yourself Out Of A Job (One That You Don't Want)
What is GitOps? How GitOps works? we discuss Key Challanges.
What is GitOps? How GitOps works? we discuss Key Challanges.
Ad

Recently uploaded (20)

PPTX
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
composite construction of structures.pdf
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPT
Mechanical Engineering MATERIALS Selection
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
Sustainable Sites - Green Building Construction
DOCX
573137875-Attendance-Management-System-original
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
Embodied AI: Ushering in the Next Era of Intelligent Systems
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
composite construction of structures.pdf
Arduino robotics embedded978-1-4302-3184-4.pdf
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Foundation to blockchain - A guide to Blockchain Tech
Mechanical Engineering MATERIALS Selection
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Sustainable Sites - Green Building Construction
573137875-Attendance-Management-System-original
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Strings in CPP - Strings in C++ are sequences of characters used to store and...
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
UNIT-1 - COAL BASED THERMAL POWER PLANTS
CYBER-CRIMES AND SECURITY A guide to understanding
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx

Jenkins workflows and Best Practices

  • 1. CI/CD Workflows and Best Practices with Jenkins Kenichi Shibata
  • 2. Why CI/CD  It is important to have a stable code which runs all the time for deployment CI/CD is necessary  If you want the code to be stable then you have to build it each time you push a new commit  Building code takes time and adds overhead for the developers. Instead of running the builds manually developers should focus on the code development.  Jenkins is a good platform to build CI/CD
  • 3. What is Jenkins?  Jenkins helps to automate the non-human part of the whole software development process,  Builds can be triggered by various means, for example by commit in a version control system, by scheduling via a cron-like mechanism and by requesting a specific build URL. It can also be triggered after the other builds in the queue have completed.  Jenkins functionality can be extended with plugins.  (from https://en.wikipedia.org/wiki/Jenkins_(software))
  • 4. Good Continuous Integration  Should be integrated with SCM such as Github/Bitbucket/Gitlab  Should run all tests defined in the code  Should send a feedback to the developers. Preferably a less disctracting means such as chat system instead of emails. (e.g. slack, hipchat, hangouts)
  • 5. Types of CI  Pull Request CI  The checks are run against the fork or the branch of the being compared against the base branch  Nightly Batch CI  The checks are being run on the base branch when no one is working on it i.e. nightly  Poll changes SCM CI  The checks are done each time something changes in the SCM (not recommended especially in big teams)  Branch merge CI  The checks are ran and then built then merged to another branch. E.g. Building a lib branch or a release branch with Binaries  Regression Based CI  The comprehensive checks are done against a branch usually production branch before deployment
  • 6. CI (cont)  It is recommended to have a code review mechanism before you merge your code to the common branch in your workflow (i.e. master, staging, production, v1)  The code review mechanism should come in two parts,  Automated Review (CI)  Manual Review (PR Review)  It is recommended therefore to have a Pull Request CI before code merge and before deployment there should be a Regression Based CI
  • 7. Sample Basic CI/CD (Good for small teams) PR to Staging Automated Review (PR CI) Manual Review Merge to Production Run regression CI Deployment Simple Deployment workflow
  • 8. Sample Agile Team Workflow PR Reviews Deployment to Integration Multi PRs Regression Deploy to Do demo every sprint demo and deploy multi prs depending on tickets which are assigned on the Sprint
  • 9. Sample Advanced CI Workflow (good for big teams) Pull Request Manual Reviews Automated Reviews UI and Unit Tests Nightly Batch CI Deployment to developer’s Environment Manual QA QA Team Rejects Or Accepts QA Creates PR Regression Test Production Deployment Needs Disposable Infrastructure for Developer’s Environment
  • 10. How to Configure Jenkins  Best Practices  There should be a jenkins which is designated for CI/CD use having a multipurpose jenkins is not recommended and critical batch jobs should not use the same resources as CI/CD  Use a separate user with its home directory jenkins is not a good user  Use small master and use master-slaves setup with majority of the workload in the slaves  Use Secure Authentication Tokens or better yet SSH Keys in configuring SCM access (need to deploy public keys on github)  Don’t use username:password  Use LDAP authentication for more secure access  Keep your jenkins inside vpn (this could cause issues if git SCM is trying to send webhooks)  If you use above setup have a secure publicly accessible NGINX proxy server to pass the payload to your jenkins inside VPN (small instance or reuse an instance will work)
  • 11. Useful Plugins  https://github.com/janinko/ghprb (pull request builder)  https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin (git access)  https://wiki.jenkins-ci.org/display/JENKINS/Simple+Theme+Plugin (readability)  (use this one to make your jenkins logs more readable go to Manage-Jenkins -> configure system -> themes  https://cdnjs.cloudflare.com/ajax/libs/doony/1.6/css/doony.min.css for css  https://cdnjs.cloudflare.com/ajax/libs/doony/1.6/js/doony.min.js for JS  https://wiki.jenkins-ci.org/display/JENKINS/Rebuild+Plugin (rebuilding)  https://wiki.jenkins-ci.org/display/JENKINS/AnsiColor+Plugin (readability)  https://wiki.jenkins-ci.org/display/JENKINS/LDAP+Plugin (LDAP security)  https://wiki.jenkins-ci.org/display/JENKINS/Matrix+Authorization+Strategy+Plugin (security)  https://wiki.jenkins-ci.org/display/JENKINS/Multijob+Plugin (upstreaming and downstreaming jobs)  https://wiki.jenkins-ci.org/display/JENKINS/Slack+Plugin (slack notification)