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

PDF
Continuous delivery with jenkins pipelines @devops pro moscow
PDF
Continuous delivery with jenkins pipelines @ devdays
PDF
Codifying the Build and Release Process with a Jenkins Pipeline Shared Library
ODP
Automatic codefixes
PDF
CI/CD Pipeline as a Code using Jenkins 2
PPTX
Jenkins pipeline as code
PPT
Test eng-meetup-taki take
PDF
Jenkins Declarative Pipelines 101
Continuous delivery with jenkins pipelines @devops pro moscow
Continuous delivery with jenkins pipelines @ devdays
Codifying the Build and Release Process with a Jenkins Pipeline Shared Library
Automatic codefixes
CI/CD Pipeline as a Code using Jenkins 2
Jenkins pipeline as code
Test eng-meetup-taki take
Jenkins Declarative Pipelines 101

What's hot (20)

PDF
Third-Party Software Library Reuse : From Adoption to Migration
PPTX
Sgnog openflow demo-v1.0
PPT
Continuous Delivery Agiles 2014 Medellin
PDF
A Next-Gen Continuous Integration Solution to Improve Software Delivery
PPTX
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
PPT
SVN Usage & Best Practices
PDF
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
PPTX
02-version control(DevOps Series)
PDF
DBMć°ˆæĄˆç’°ćąƒć»șçœź
PPTX
SVN Basics
PPTX
In a HTTP/2 World - DeccanRubyConf 2017
PPTX
Git collaboration
PPTX
Mavenized RCP
PDF
Version Control with SVN
PPT
SVN Tool Information : Best Practices
PPT
Totalsvn Usage And Administration By Gopi
PDF
Subversion Best Practices
PDF
PAC 2019 virtual Scott Moore
 
PPTX
Symfony Under Control by Maxim Romanovsky
PDF
Version Control with Subversion
Third-Party Software Library Reuse : From Adoption to Migration
Sgnog openflow demo-v1.0
Continuous Delivery Agiles 2014 Medellin
A Next-Gen Continuous Integration Solution to Improve Software Delivery
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
SVN Usage & Best Practices
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
02-version control(DevOps Series)
DBMć°ˆæĄˆç’°ćąƒć»șçœź
SVN Basics
In a HTTP/2 World - DeccanRubyConf 2017
Git collaboration
Mavenized RCP
Version Control with SVN
SVN Tool Information : Best Practices
Totalsvn Usage And Administration By Gopi
Subversion Best Practices
PAC 2019 virtual Scott Moore
 
Symfony Under Control by Maxim Romanovsky
Version Control with Subversion
Ad

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

PPTX
Continuous Delivery with Jenkins
PDF
Continuous delivery with jenkins pipelines (@devfest Vienna)
PPTX
Ordina Accelerator program 2019 - Jenkins blue ocean pipelines
PDF
Jenkins Pipelines
PPTX
Pipeline as code - new feature in Jenkins 2
PDF
JavaOne 2016 - Pipeline as code
PDF
Continuous delivery with jenkins pipelines incl. dev tools (@ Vienna DevOps &...
PDF
(Declarative) Jenkins Pipelines
PPTX
Jenkins2 - Coding Continuous Delivery Pipelines
PDF
Implementing CI CD UiPath Using Jenkins Plugin
PDF
Pipeline: Continuous Delivery as Code in Jenkins 2.0
PDF
7 Habits of Highly Effective Jenkins Users
ODP
Pipeline based deployments on Jenkins
PPTX
Basic Jenkins Guide.pptx
PDF
Software Delivery in 2016 - A Continuous Delivery Approach
PDF
Pipeline as Code Continuous Delivery with Jenkins Kubernetes and Terraform 1s...
PDF
vodQA Pune (2019) - Jenkins pipeline As code
 
PDF
Jenkins : Pipeline As Code
PDF
Continuous Delivery @ Codemotion
PDF
Jenkins Continuous Delivery
Continuous Delivery with Jenkins
Continuous delivery with jenkins pipelines (@devfest Vienna)
Ordina Accelerator program 2019 - Jenkins blue ocean pipelines
Jenkins Pipelines
Pipeline as code - new feature in Jenkins 2
JavaOne 2016 - Pipeline as code
Continuous delivery with jenkins pipelines incl. dev tools (@ Vienna DevOps &...
(Declarative) Jenkins Pipelines
Jenkins2 - Coding Continuous Delivery Pipelines
Implementing CI CD UiPath Using Jenkins Plugin
Pipeline: Continuous Delivery as Code in Jenkins 2.0
7 Habits of Highly Effective Jenkins Users
Pipeline based deployments on Jenkins
Basic Jenkins Guide.pptx
Software Delivery in 2016 - A Continuous Delivery Approach
Pipeline as Code Continuous Delivery with Jenkins Kubernetes and Terraform 1s...
vodQA Pune (2019) - Jenkins pipeline As code
 
Jenkins : Pipeline As Code
Continuous Delivery @ Codemotion
Jenkins Continuous Delivery
Ad

More from Roman Pickl (7)

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

Recently uploaded (20)

PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
 
PPTX
L1 - Introduction to python Backend.pptx
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
System and Network Administration Chapter 2
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
ai tools demonstartion for schools and inter college
PDF
medical staffing services at VALiNTRY
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Digital Strategies for Manufacturing Companies
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
 
L1 - Introduction to python Backend.pptx
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
2025 Textile ERP Trends: SAP, Odoo & Oracle
Design an Analysis of Algorithms II-SECS-1021-03
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Operating system designcfffgfgggggggvggggggggg
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
System and Network Administration Chapter 2
Navsoft: AI-Powered Business Solutions & Custom Software Development
VVF-Customer-Presentation2025-Ver1.9.pptx
Reimagine Home Health with the Power of Agentic AI​
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Wondershare Filmora 15 Crack With Activation Key [2025
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
ai tools demonstartion for schools and inter college
medical staffing services at VALiNTRY
How Creative Agencies Leverage Project Management Software.pdf
Digital Strategies for Manufacturing Companies

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