SlideShare a Scribd company logo
17.09.2018
Roman Pickl
Continuous Delivery with Jenkins
Pipelines
3© Elektrobit (EB) 2018 3
1. docker run -p 8080:8080 jenkinsci/blueocean (add –p 44444:44444 or any other port to try
the ssh linter)
2. Go to http://localhost:8080/
3. Unlock jenkins with initialpw from log file
4. Install suggested plugins (you may have to continue the process in case any plugins are
broken and update plugins later on)
5. Create admin user / or continue with admin and initalpw
6. Open http://localhost:8080/blue/pipelines
7. Generate new Pipeline with Github repository
8. Create Jenkinsfile (e.g. https://github.com/rompic/jenkinspipeline)
Demo
Continuous Delivery with Jenkins Pipelines
4© Elektrobit (EB) 2018
• Technical Project Manager @ Elektrobit
• Uses Jenkins since 2012
• Loves CI/CD/DevOps
• Here to learn
Roman Pickl (@rompic)
How did I end up here?
Continuous Delivery with Jenkins Pipelines
5© Elektrobit (EB) 2018
Jez Humble on Continuous Delivery(2012): https://www.youtube.com/watch?v=skLJuksCRTw
Automated implementation of your system’s build, deploy, test,
release process
• Every change results in a build
• Every build is a release candidate
• Delivery can be done at any time, on any environment
 Make releases a non-event
Deployment Pipeline provides:
• Visibility
• Feedback
• Control
Continuous Delivery (CD)
Continuous Delivery with Jenkins Pipelines
Read these books
if you want to
know more!
6© Elektrobit (EB) 2018
Jez Humble D. F., Continuous Delivery: Reliable Software Releases Through Build, Test, and Deployment Automation (2010)
Deployment Pipelines (Let’s build it with jenkins)
Continuous Delivery with Jenkins Pipelines
7© Elektrobit (EB) 2018
http://dduportal.github.io/presentations/mixit-2017-jenkins-pipeline/slides.html#/meet_jenkins
https://jenkins.io/blog/2017/04/05/say-hello-blueocean-1-0/
http://stats.jenkins.io/
• Created by Kohsuke Kawaguchi
• Initial Release 2005 (Hudson)
• Open Source (MIT License)
• Active and independent community (https://jenkins.io)
• 178,800 active installations
• 1,600+ plugins (!)
• Since 2.0 Pipelines (April 2016) are first class citizens
• Pipeline as Code (Jenkinsfile).
• New User Experience “Blue Ocean” with Blue Ocean Pipeline Editor
• Blue Ocean 1.8 released in August 2018
#1 Continuous Integration and Delivery Server
Jenkins
Continuous Delivery with Jenkins Pipelines
8© Elektrobit (EB) 2018
Welcome Blue Ocean!
Continuous Delivery with Jenkins Pipelines
9© Elektrobit (EB) 2018
4.Choose a repository
3. Choose organization
2. Provide access key
1. Type of source control
Create a Pipeline Wizard
Continuous Delivery with Jenkins Pipelines
10© Elektrobit (EB) 2018
https://jenkins.io/doc/book/pipeline/jenkinsfile/
Written in a Groovy DSL
“Jenkinsfile” in top level folder (different path possible since June
2017 https://issues.jenkins-ci.org/browse/JENKINS-34561)
Store in SCM (e.g. GIT) for additional benefits
• Code review/iteration
• Audit trail
• Single source of truth
Supports two syntaxes (can be mixed)
• Declarative pipelines (easier; “new”; 1.0 Feb 2017)
• Scripted pipelines (more powerful)
Jenkinsfile
Continuous Delivery with Jenkins Pipelines
11© Elektrobit (EB) 2018
https://jenkins.io/doc/book/pipeline/syntax/
Declarative PipelineScripted Pipelines
Continuous Delivery with Jenkins Pipelines
Scripted vs. Declarative
12© Elektrobit (EB) 2018
https://jenkins.io/doc/book/pipeline/syntax/
Declarative PipelineScripted Pipelines
Continuous Delivery with Jenkins Pipelines
Scripted vs. Declarative
• imperative programming model
• fully featured programming environment,
• higher flexibility and extensibility
• very few limits
 for power-users and more complex requirements
• declarative programming model
• simpler and more opinionated syntax for authoring Jenkins
Pipeline.
• Allows for validation and a visual editor
• limits what is available to the user
 ideal choice for simpler continuous delivery pipelines
Both
• use Groovy
• same Pipeline sub-system underneath
• mostly use same steps
• able to utilize Shared Libraries
 can be mixed using the script step
See https://jenkins.io/blog/2017/01/19/converting-conditional-to-pipeline/ for a more complex example of migrating a freestyle job to a
declarative/scripted pipeline.
13© Elektrobit (EB) 2018
https://jenkins.io/doc/book/pipeline/syntax/
• takes a block of Scripted Pipeline & executes that in the
Declarative Pipeline
• can provide a useful "escape hatch".
• script blocks of non-trivial size and/or complexity should be
moved into Shared Libraries
script Step
Continuous Delivery with Jenkins Pipelines
14© Elektrobit (EB) 2018
Settings
Continuous Delivery with Jenkins Pipelines
15© Elektrobit (EB) 2018
Stages
Continuous Delivery with Jenkins Pipelines
16© Elektrobit (EB) 2018
Parallel Execution
Continuous Delivery with Jenkins Pipelines
Declarative 1.3 (released 14.06.2018) allows you to add multiple
“sequential” stages in the same parallel branch.
See https://www.cloudbees.com/blog/whats-new-declarative-pipeline-
13-sequential-stages
17© Elektrobit (EB) 2018
Approval
Continuous Delivery with Jenkins Pipelines
Deploy to Live / Release omitted here
18© Elektrobit (EB) 2018
Post Build Notifications
Continuous Delivery with Jenkins Pipelines
19© Elektrobit (EB) 2018 19
https://jenkins.io/blog/2018/04/18/blueocean-1-5-0/
https://wiki.jenkins.io/display/JENKINS/Blue+Ocean+Plugin
• Latest additions
– Support for sequential parallel stages
– Restartable Stages for declarative pipelines
– Performance improvements
Public roadmap
• https://jenkins.io/projects/blueocean/roadmap/
Blue Ocean 1.8.2 released 16.08.2018
Continuous Delivery with Jenkins Pipelines
20© Elektrobit (EB) 2018 20
Overview
Continuous Delivery with Jenkins Pipelines
21© Elektrobit (EB) 2018 21
Approval
Continuous Delivery with Jenkins Pipelines
22© Elektrobit (EB) 2018 22
Detail
Continuous Delivery with Jenkins Pipelines
23© Elektrobit (EB) 2018 23
Multi branch support
Continuous Delivery with Jenkins Pipelines
24© Elektrobit (EB) 2018 24
Multi branch (When)
Continuous Delivery with Jenkins Pipelines
25© Elektrobit (EB) 2018 25© Elektrobit (EB) 2018 | Confidential
• Blue Ocean Pipeline Editor
• Snippet Generator
• Directive Generator
• Replay Feature
• Shared Libraries
• Auto-Convert Freestyle Jobs to Jenkins Pipeline
• IntelliJ IDEA GDSL – Autocomplete
• Command-line Pipeline Linter
• Jenkins File Runner
• Unit Testing Jenkins Pipelines
Pipeline Development and Advanced Tools
Continuous Delivery with Jenkins Pipelines
26© Elektrobit (EB) 2018
• GitLab currently not supported (planned! https://issues.jenkins-ci.org/browse/JENKINS-43976)
• Workaround: http://localhost:8080/blue/organizations/jenkins/pipeline-editor/
• Ctrl-S / Cmd-S to open the load save dialog
Pipeline Editor
Continuous Delivery with Jenkins Pipelines
27© Elektrobit (EB) 2018
• http://localhost:8080/pipeline-syntax
Snippet generator
Continuous Delivery with Jenkins Pipelines
28© Elektrobit (EB) 2018
• http://localhost:8080/directive-generator/
• https://jenkins.io/blog/2018/04/09/whats-in-declarative/
Declarative generator
Continuous Delivery with Jenkins Pipelines
30© Elektrobit (EB) 2018
• Allows for quick modifications and execution of an existing
(valid!) Pipeline without changing the Pipeline configuration or
creating a new commit.
• Once you are satisfied with the changes, you can use Replay to
view them again, copy them back to your Pipeline job or
Jenkinsfile, and then commit them using your usual engineering
processes
Green sub-title
Replay Feature
Continuous Delivery with Jenkins Pipelines
34© Elektrobit (EB) 2018
Share parts of Pipelines between various projects to reduce
redundancies and keep code "DRY“.
Functions can than be called from Jenkinsfiles.
See
https://jenkins.io/doc/book/pipeline/shared-libraries/
and
https://jenkins.io/blog/2017/10/02/pipeline-templates-with-
shared-libraries/
for more details.
Green sub-title
Shared Libraries
Continuous Delivery with Jenkins Pipelines
36© Elektrobit (EB) 2018
• Missing:
– Support for passing variables between stages in declarative pipelines (see workaround in https://issues.jenkins-ci.org/browse/JENKINS-41335 and
discussion in https://stackoverflow.com/questions/47462500/pass-variables-between-jenkins-stages and
https://stackoverflow.com/questions/43879733/jenkinsfile-declarative-pipeline-defining-dynamic-env-vars/43881731#43881731)
• To Come:
– More editor coverage of declaration syntax
– GitLab read/write support
– For more see https://jenkins.io/projects/blueocean/roadmap/ and https://jenkins.io/blog/2018/08/31/shifting-gears/
Things missing / Things to come
Continuous Delivery with Jenkins Pipelines
37© Elektrobit (EB) 2018
• Website: https://jenkins.io
• Blog: https://jenkins.io/node/
• https://www.slideshare.net/legrimpeur/belgium-jenkins-area-meetup-jenkins-blueocean-and-declarative-pipelines
• Getting Started
• https://jenkins.io/doc/book/getting-started/
• https://jenkins.io/doc/book/pipeline/syntax/
• https://jenkins.io/doc/tutorials/
• https://jenkins.io/doc/pipeline/steps/
• https://jenkins.io/doc/book/blueocean/getting-started/
• https://github.com/jenkinsci/pipeline-model-definition-plugin/wiki/getting%20started
• https://jenkins.io/blog/2017/05/18/pipeline-dev-tools/
Further references & information I
Continuous Delivery with Jenkins Pipelines
38© Elektrobit (EB) 2018
Docker Files:
• https://github.com/jenkinsci/docker/blob/master/README.md
• https://hub.docker.com/r/jenkinsci/blueocean/
Further references & information II
Continuous Delivery with Jenkins Pipelines
Roman Pickl (@rompic)
roman.pickl@elektrobit.com
www.elektrobit.com
Get in touch!

More Related Content

What's hot (20)

PDF
Third-Party Software Library Reuse : From Adoption to Migration
Ali Ouni
 
PPTX
Sgnog openflow demo-v1.0
Jason Kalai Arasu
 
PPT
Continuous Delivery Agiles 2014 Medellin
Diego Garber
 
PDF
A Next-Gen Continuous Integration Solution to Improve Software Delivery
Christina Rasimus
 
PPTX
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
Werner Keil
 
PPT
SVN Usage & Best Practices
Ashraf Fouad
 
PDF
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Edureka!
 
PPTX
02-version control(DevOps Series)
Mohammed Shaban
 
PDF
DBM專案環境建置
Guo Albert
 
PPTX
SVN Basics
Shiva Somvanshi
 
PPTX
In a HTTP/2 World - DeccanRubyConf 2017
Douglas Vaz
 
PPTX
Git collaboration
Pham Quy (Jack)
 
PPTX
Mavenized RCP
Marc Jimenez
 
PDF
Version Control with SVN
PHPBelgium
 
PPT
SVN Tool Information : Best Practices
Maidul Islam
 
PPT
Totalsvn Usage And Administration By Gopi
gopinathkarangula
 
PDF
Subversion Best Practices
Matt Wood
 
PDF
PAC 2019 virtual Scott Moore
Neotys
 
PPTX
Symfony Under Control by Maxim Romanovsky
php-user-group-minsk
 
PDF
Version Control with Subversion
Guy K. Kloss
 
Third-Party Software Library Reuse : From Adoption to Migration
Ali Ouni
 
Sgnog openflow demo-v1.0
Jason Kalai Arasu
 
Continuous Delivery Agiles 2014 Medellin
Diego Garber
 
A Next-Gen Continuous Integration Solution to Improve Software Delivery
Christina Rasimus
 
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
Werner Keil
 
SVN Usage & Best Practices
Ashraf Fouad
 
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Edureka!
 
02-version control(DevOps Series)
Mohammed Shaban
 
DBM專案環境建置
Guo Albert
 
SVN Basics
Shiva Somvanshi
 
In a HTTP/2 World - DeccanRubyConf 2017
Douglas Vaz
 
Git collaboration
Pham Quy (Jack)
 
Mavenized RCP
Marc Jimenez
 
Version Control with SVN
PHPBelgium
 
SVN Tool Information : Best Practices
Maidul Islam
 
Totalsvn Usage And Administration By Gopi
gopinathkarangula
 
Subversion Best Practices
Matt Wood
 
PAC 2019 virtual Scott Moore
Neotys
 
Symfony Under Control by Maxim Romanovsky
php-user-group-minsk
 
Version Control with Subversion
Guy K. Kloss
 

Similar to Continuous delivery with jenkins pipelines @devopsdays cairo (20)

PPTX
Continuous Delivery with Jenkins
Jadson Santos
 
PDF
Continuous delivery with jenkins pipelines (@devfest Vienna)
Roman Pickl
 
PPTX
Ordina Accelerator program 2019 - Jenkins blue ocean pipelines
Bert Koorengevel
 
PDF
Jenkins Pipelines
Steffen Gebert
 
PPTX
Pipeline as code - new feature in Jenkins 2
Michal Ziarnik
 
PDF
JavaOne 2016 - Pipeline as code
Bert Jan Schrijver
 
PDF
Continuous delivery with jenkins pipelines incl. dev tools (@ Vienna DevOps &...
Roman Pickl
 
PDF
(Declarative) Jenkins Pipelines
Steffen Gebert
 
PPTX
Jenkins2 - Coding Continuous Delivery Pipelines
Brent Laster
 
PDF
Implementing CI CD UiPath Using Jenkins Plugin
Satish Prasad
 
PDF
Pipeline: Continuous Delivery as Code in Jenkins 2.0
Jules Pierre-Louis
 
PDF
7 Habits of Highly Effective Jenkins Users
Jules Pierre-Louis
 
ODP
Pipeline based deployments on Jenkins
Knoldus Inc.
 
PPTX
Basic Jenkins Guide.pptx
Jayanga V. Liyanage
 
PDF
Software Delivery in 2016 - A Continuous Delivery Approach
Giovanni Toraldo
 
PDF
Pipeline as Code Continuous Delivery with Jenkins Kubernetes and Terraform 1s...
naveencwana55
 
PDF
vodQA Pune (2019) - Jenkins pipeline As code
vodQA
 
PDF
Jenkins : Pipeline As Code
Shreyas Chaudhari
 
PDF
Continuous Delivery @ Codemotion
Miguel Serrano Milano
 
PDF
Jenkins Continuous Delivery
Jadson Santos
 
Continuous Delivery with Jenkins
Jadson Santos
 
Continuous delivery with jenkins pipelines (@devfest Vienna)
Roman Pickl
 
Ordina Accelerator program 2019 - Jenkins blue ocean pipelines
Bert Koorengevel
 
Jenkins Pipelines
Steffen Gebert
 
Pipeline as code - new feature in Jenkins 2
Michal Ziarnik
 
JavaOne 2016 - Pipeline as code
Bert Jan Schrijver
 
Continuous delivery with jenkins pipelines incl. dev tools (@ Vienna DevOps &...
Roman Pickl
 
(Declarative) Jenkins Pipelines
Steffen Gebert
 
Jenkins2 - Coding Continuous Delivery Pipelines
Brent Laster
 
Implementing CI CD UiPath Using Jenkins Plugin
Satish Prasad
 
Pipeline: Continuous Delivery as Code in Jenkins 2.0
Jules Pierre-Louis
 
7 Habits of Highly Effective Jenkins Users
Jules Pierre-Louis
 
Pipeline based deployments on Jenkins
Knoldus Inc.
 
Basic Jenkins Guide.pptx
Jayanga V. Liyanage
 
Software Delivery in 2016 - A Continuous Delivery Approach
Giovanni Toraldo
 
Pipeline as Code Continuous Delivery with Jenkins Kubernetes and Terraform 1s...
naveencwana55
 
vodQA Pune (2019) - Jenkins pipeline As code
vodQA
 
Jenkins : Pipeline As Code
Shreyas Chaudhari
 
Continuous Delivery @ Codemotion
Miguel Serrano Milano
 
Jenkins Continuous Delivery
Jadson Santos
 
Ad

More from Roman Pickl (7)

PDF
Are we really moving faster? How visualizing flow changed the way we work
Roman Pickl
 
PDF
Are we really moving faster? How visualizing flow changed the way we work
Roman Pickl
 
PDF
Are we really moving faster? How visualizing flow changed the way we work
Roman Pickl
 
PPTX
Are we really moving faster? How visualizing flow changed the way we work - ...
Roman Pickl
 
PDF
Continuous Code Quality with the Sonar Ecosystem @GeeCON 2017 in Prague
Roman Pickl
 
PDF
Continuous delivery with jenkins pipelines (@WeAreDevelopers2017)
Roman Pickl
 
PPTX
Continuous Code Quality with the sonar ecosystem
Roman Pickl
 
Are we really moving faster? How visualizing flow changed the way we work
Roman Pickl
 
Are we really moving faster? How visualizing flow changed the way we work
Roman Pickl
 
Are we really moving faster? How visualizing flow changed the way we work
Roman Pickl
 
Are we really moving faster? How visualizing flow changed the way we work - ...
Roman Pickl
 
Continuous Code Quality with the Sonar Ecosystem @GeeCON 2017 in Prague
Roman Pickl
 
Continuous delivery with jenkins pipelines (@WeAreDevelopers2017)
Roman Pickl
 
Continuous Code Quality with the sonar ecosystem
Roman Pickl
 
Ad

Recently uploaded (20)

PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PPTX
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Online Queue Management System for Public Service Offices in Nepal [Focused i...
Rishab Acharya
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PDF
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Tally software_Introduction_Presentation
AditiBansal54083
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Online Queue Management System for Public Service Offices in Nepal [Focused i...
Rishab Acharya
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 

Continuous delivery with jenkins pipelines @devopsdays cairo

  • 2. 3© Elektrobit (EB) 2018 3 1. docker run -p 8080:8080 jenkinsci/blueocean (add –p 44444:44444 or any other port to try the ssh linter) 2. Go to http://localhost:8080/ 3. Unlock jenkins with initialpw from log file 4. Install suggested plugins (you may have to continue the process in case any plugins are broken and update plugins later on) 5. Create admin user / or continue with admin and initalpw 6. Open http://localhost:8080/blue/pipelines 7. Generate new Pipeline with Github repository 8. Create Jenkinsfile (e.g. https://github.com/rompic/jenkinspipeline) Demo Continuous Delivery with Jenkins Pipelines
  • 3. 4© Elektrobit (EB) 2018 • Technical Project Manager @ Elektrobit • Uses Jenkins since 2012 • Loves CI/CD/DevOps • Here to learn Roman Pickl (@rompic) How did I end up here? Continuous Delivery with Jenkins Pipelines
  • 4. 5© Elektrobit (EB) 2018 Jez Humble on Continuous Delivery(2012): https://www.youtube.com/watch?v=skLJuksCRTw Automated implementation of your system’s build, deploy, test, release process • Every change results in a build • Every build is a release candidate • Delivery can be done at any time, on any environment  Make releases a non-event Deployment Pipeline provides: • Visibility • Feedback • Control Continuous Delivery (CD) Continuous Delivery with Jenkins Pipelines Read these books if you want to know more!
  • 5. 6© Elektrobit (EB) 2018 Jez Humble D. F., Continuous Delivery: Reliable Software Releases Through Build, Test, and Deployment Automation (2010) Deployment Pipelines (Let’s build it with jenkins) Continuous Delivery with Jenkins Pipelines
  • 6. 7© Elektrobit (EB) 2018 http://dduportal.github.io/presentations/mixit-2017-jenkins-pipeline/slides.html#/meet_jenkins https://jenkins.io/blog/2017/04/05/say-hello-blueocean-1-0/ http://stats.jenkins.io/ • Created by Kohsuke Kawaguchi • Initial Release 2005 (Hudson) • Open Source (MIT License) • Active and independent community (https://jenkins.io) • 178,800 active installations • 1,600+ plugins (!) • Since 2.0 Pipelines (April 2016) are first class citizens • Pipeline as Code (Jenkinsfile). • New User Experience “Blue Ocean” with Blue Ocean Pipeline Editor • Blue Ocean 1.8 released in August 2018 #1 Continuous Integration and Delivery Server Jenkins Continuous Delivery with Jenkins Pipelines
  • 7. 8© Elektrobit (EB) 2018 Welcome Blue Ocean! Continuous Delivery with Jenkins Pipelines
  • 8. 9© Elektrobit (EB) 2018 4.Choose a repository 3. Choose organization 2. Provide access key 1. Type of source control Create a Pipeline Wizard Continuous Delivery with Jenkins Pipelines
  • 9. 10© Elektrobit (EB) 2018 https://jenkins.io/doc/book/pipeline/jenkinsfile/ Written in a Groovy DSL “Jenkinsfile” in top level folder (different path possible since June 2017 https://issues.jenkins-ci.org/browse/JENKINS-34561) Store in SCM (e.g. GIT) for additional benefits • Code review/iteration • Audit trail • Single source of truth Supports two syntaxes (can be mixed) • Declarative pipelines (easier; “new”; 1.0 Feb 2017) • Scripted pipelines (more powerful) Jenkinsfile Continuous Delivery with Jenkins Pipelines
  • 10. 11© Elektrobit (EB) 2018 https://jenkins.io/doc/book/pipeline/syntax/ Declarative PipelineScripted Pipelines Continuous Delivery with Jenkins Pipelines Scripted vs. Declarative
  • 11. 12© Elektrobit (EB) 2018 https://jenkins.io/doc/book/pipeline/syntax/ Declarative PipelineScripted Pipelines Continuous Delivery with Jenkins Pipelines Scripted vs. Declarative • imperative programming model • fully featured programming environment, • higher flexibility and extensibility • very few limits  for power-users and more complex requirements • declarative programming model • simpler and more opinionated syntax for authoring Jenkins Pipeline. • Allows for validation and a visual editor • limits what is available to the user  ideal choice for simpler continuous delivery pipelines Both • use Groovy • same Pipeline sub-system underneath • mostly use same steps • able to utilize Shared Libraries  can be mixed using the script step See https://jenkins.io/blog/2017/01/19/converting-conditional-to-pipeline/ for a more complex example of migrating a freestyle job to a declarative/scripted pipeline.
  • 12. 13© Elektrobit (EB) 2018 https://jenkins.io/doc/book/pipeline/syntax/ • takes a block of Scripted Pipeline & executes that in the Declarative Pipeline • can provide a useful "escape hatch". • script blocks of non-trivial size and/or complexity should be moved into Shared Libraries script Step Continuous Delivery with Jenkins Pipelines
  • 13. 14© Elektrobit (EB) 2018 Settings Continuous Delivery with Jenkins Pipelines
  • 14. 15© Elektrobit (EB) 2018 Stages Continuous Delivery with Jenkins Pipelines
  • 15. 16© Elektrobit (EB) 2018 Parallel Execution Continuous Delivery with Jenkins Pipelines Declarative 1.3 (released 14.06.2018) allows you to add multiple “sequential” stages in the same parallel branch. See https://www.cloudbees.com/blog/whats-new-declarative-pipeline- 13-sequential-stages
  • 16. 17© Elektrobit (EB) 2018 Approval Continuous Delivery with Jenkins Pipelines Deploy to Live / Release omitted here
  • 17. 18© Elektrobit (EB) 2018 Post Build Notifications Continuous Delivery with Jenkins Pipelines
  • 18. 19© Elektrobit (EB) 2018 19 https://jenkins.io/blog/2018/04/18/blueocean-1-5-0/ https://wiki.jenkins.io/display/JENKINS/Blue+Ocean+Plugin • Latest additions – Support for sequential parallel stages – Restartable Stages for declarative pipelines – Performance improvements Public roadmap • https://jenkins.io/projects/blueocean/roadmap/ Blue Ocean 1.8.2 released 16.08.2018 Continuous Delivery with Jenkins Pipelines
  • 19. 20© Elektrobit (EB) 2018 20 Overview Continuous Delivery with Jenkins Pipelines
  • 20. 21© Elektrobit (EB) 2018 21 Approval Continuous Delivery with Jenkins Pipelines
  • 21. 22© Elektrobit (EB) 2018 22 Detail Continuous Delivery with Jenkins Pipelines
  • 22. 23© Elektrobit (EB) 2018 23 Multi branch support Continuous Delivery with Jenkins Pipelines
  • 23. 24© Elektrobit (EB) 2018 24 Multi branch (When) Continuous Delivery with Jenkins Pipelines
  • 24. 25© Elektrobit (EB) 2018 25© Elektrobit (EB) 2018 | Confidential • Blue Ocean Pipeline Editor • Snippet Generator • Directive Generator • Replay Feature • Shared Libraries • Auto-Convert Freestyle Jobs to Jenkins Pipeline • IntelliJ IDEA GDSL – Autocomplete • Command-line Pipeline Linter • Jenkins File Runner • Unit Testing Jenkins Pipelines Pipeline Development and Advanced Tools Continuous Delivery with Jenkins Pipelines
  • 25. 26© Elektrobit (EB) 2018 • GitLab currently not supported (planned! https://issues.jenkins-ci.org/browse/JENKINS-43976) • Workaround: http://localhost:8080/blue/organizations/jenkins/pipeline-editor/ • Ctrl-S / Cmd-S to open the load save dialog Pipeline Editor Continuous Delivery with Jenkins Pipelines
  • 26. 27© Elektrobit (EB) 2018 • http://localhost:8080/pipeline-syntax Snippet generator Continuous Delivery with Jenkins Pipelines
  • 27. 28© Elektrobit (EB) 2018 • http://localhost:8080/directive-generator/ • https://jenkins.io/blog/2018/04/09/whats-in-declarative/ Declarative generator Continuous Delivery with Jenkins Pipelines
  • 28. 30© Elektrobit (EB) 2018 • Allows for quick modifications and execution of an existing (valid!) Pipeline without changing the Pipeline configuration or creating a new commit. • Once you are satisfied with the changes, you can use Replay to view them again, copy them back to your Pipeline job or Jenkinsfile, and then commit them using your usual engineering processes Green sub-title Replay Feature Continuous Delivery with Jenkins Pipelines
  • 29. 34© Elektrobit (EB) 2018 Share parts of Pipelines between various projects to reduce redundancies and keep code "DRY“. Functions can than be called from Jenkinsfiles. See https://jenkins.io/doc/book/pipeline/shared-libraries/ and https://jenkins.io/blog/2017/10/02/pipeline-templates-with- shared-libraries/ for more details. Green sub-title Shared Libraries Continuous Delivery with Jenkins Pipelines
  • 30. 36© Elektrobit (EB) 2018 • Missing: – Support for passing variables between stages in declarative pipelines (see workaround in https://issues.jenkins-ci.org/browse/JENKINS-41335 and discussion in https://stackoverflow.com/questions/47462500/pass-variables-between-jenkins-stages and https://stackoverflow.com/questions/43879733/jenkinsfile-declarative-pipeline-defining-dynamic-env-vars/43881731#43881731) • To Come: – More editor coverage of declaration syntax – GitLab read/write support – For more see https://jenkins.io/projects/blueocean/roadmap/ and https://jenkins.io/blog/2018/08/31/shifting-gears/ Things missing / Things to come Continuous Delivery with Jenkins Pipelines
  • 31. 37© Elektrobit (EB) 2018 • Website: https://jenkins.io • Blog: https://jenkins.io/node/ • https://www.slideshare.net/legrimpeur/belgium-jenkins-area-meetup-jenkins-blueocean-and-declarative-pipelines • Getting Started • https://jenkins.io/doc/book/getting-started/ • https://jenkins.io/doc/book/pipeline/syntax/ • https://jenkins.io/doc/tutorials/ • https://jenkins.io/doc/pipeline/steps/ • https://jenkins.io/doc/book/blueocean/getting-started/ • https://github.com/jenkinsci/pipeline-model-definition-plugin/wiki/getting%20started • https://jenkins.io/blog/2017/05/18/pipeline-dev-tools/ Further references & information I Continuous Delivery with Jenkins Pipelines
  • 32. 38© Elektrobit (EB) 2018 Docker Files: • https://github.com/jenkinsci/docker/blob/master/README.md • https://hub.docker.com/r/jenkinsci/blueocean/ Further references & information II Continuous Delivery with Jenkins Pipelines