Continuous delivery with jenkins pipelines (@devfest Vienna)

© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Continuous Delivery with Jenkins Pipelines (incl.
Advanced Topics)
Roman Pickl
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
• 10+ years’ experience in integrating
transport systems
• 22 mobility Apps in the stores
• 43+ million requests / month
• 500.000+ unique users / month
At a glance
qando
Vienna, Linz, Graz,
Salzburg, Klagenfurt.
SMILE
Lighthouse project for
integrated mobility
Wien Mobil Lab
Vienna
FluidHub
Powering the Integrated Mobility and MaaS Ecosystem
2009
avv connect
Aachen Region, North
Rhine-Westphalia.
2014
NUMO
Vienna
2012 2015 2016
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
How did I end up here?
• Roman Pickl (@rompic)
• CTO @ Fluidtime
• In charge of the technical development
• Uses Jenkins since 2012
• Loves CI/CD/DevOps
• Here to learn
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Continuous Delivery (CD)
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
Read these books!
Jez Humble on Continuous Delivery(2012): https://www.youtube.com/watch?v=skLJuksCRTw
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Deployment Pipelines (Let’s build it with jenkins)
(Jez Humble D. F., Continuous Delivery: Reliable Software Releases Through Build, Test, and Deployment Automation, 2010)
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Jenkins
#1 Continuous Integration and Delivery server
•Created by Kohsuke Kawaguchi
•Initial Release 2005 (Hudson)
•Open Source (MIT License)
•Active and independent community (https://jenkins.io)
•155,000 active installations
•1,500+ 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
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/
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Welcome Blue Ocean!
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Create a Pipeline Wizard
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
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)
https://jenkins.io/doc/book/pipeline/jenkinsfile/
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Scripted vs. Declarative
Scripted Pipelines: Declarative Pipeline:
https://jenkins.io/doc/book/pipeline/syntax/
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Scripted vs. Declarative
Scripted Pipeline: Declarative Pipeline:
https://jenkins.io/doc/book/pipeline/syntax/
• 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
pipelinesBoth:
• 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.
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
script Step
• 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
https://jenkins.io/doc/book/pipeline/syntax/
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Settings
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Stages
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Parallel Execution
With
declarative1.2
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Approval
...
Deploy to Stage, Deploy Live, Release omitted here
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Post Build Notifications
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Demo
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)
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Blue Ocean 1.3.3 released 16.11.2017
• https://wiki.jenkins.io/display/JENKINS/Blue+Ocean+Plugin
• Latest additions
• JIRA integration
• Declarative Pipeline version 1.2 support
• Support of different Repositories
Public roadmap
https://jenkins.io/projects/blueocean/roadmap/
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Overview
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Approval
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Detail
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Multi branch support
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Multi branch (When)
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Pipeline Development and Advanced Tools
• Blue Ocean Pipeline Editor
• Snippet Generator
• IntelliJ IDEA GDSL – Autocomplete
• Command-line Pipeline Linter
• Replay Feature
• Unit Testing Jenkins Pipelines
• Shared Libaries
https://jenkins.io/doc/book/pipeline/development/
https://jenkins.io/doc/book/pipeline/shared-libraries/
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Pipeline Editor
GitLab currently not supported (planned! https://issues.jenkins-ci.org/browse/JENKINS-43148)
Workaround: http://localhost:8080/blue/organizations/jenkins/pipeline-editor/
Ctrl-S / Cmd-S to open the load save dialog
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Snippet generator
http://localhost:8080/pipeline-syntax
https://jenkins.io/doc/book/pipeline/getting-started/#snippet-generator
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
IntelliJ IDEA GDSL - Autocomplete
• Autocompletion of steps for scripted pipelines
• Install Groovy Plugin
• Download http://localhost:8080/pipeline-syntax/gdsl
• Add it as e.g. pipeline.gdsl to your projects src path
See
https://st-g.de/2016/08/jenkins-pipeline-autocompletion-in-intellij
https://stackoverflow.com/questions/41062514/use-gdsl-file-in-a-java-project-in-intellij
https://stackoverflow.com/a/41149255/3165782
for setting it up.
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Command-line Pipeline Linter
Validate Declarative Pipelines from the cli before actually running it/checking it in.
See https://jenkins.io/doc/book/pipeline/development/#linter for details. Remember to
enable SSH access, expose a port on your docker container and add ssh key to try this!
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Replay Feature
• 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
https://jenkins.io/doc/book/pipeline/development/
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Shared Libraries
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/shar
ed-libraries/
and
https://jenkins.io/blog/2017/10/02/pipe
line-templates-with-shared-libraries/
for more details.
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Unit Testing Jenkins Pipelines
•Allows to unit test Pipelines and Shared Libraries before running them in full
•Provides a mock execution environment that can be used to check for expected behavior
•Still quite rough around the edges. (e.g. no support for declarative pipeline yet
https://github.com/lesfurets/JenkinsPipelineUnit/pull/13)
See:
https://github.com/lesfurets/JenkinsPipelineUnit
https://github.com/lesfurets/JenkinsPipelineUnit/blob/master/README.md
https://issues.jenkins-ci.org/browse/JENKINS-33925
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Things missing / Things to come
Missing:
• Support for definition of variables in declarative pipelines (see workaround in
https://issues.jenkins-ci.org/browse/JENKINS-41335)
• Keep build forever (https://issues.jenkins-ci.org/browse/JENKINS-39028 ;
workaround via shared lib)
• Restart stages for pipelines (checkpoint as commercial feature, https://issues.jenkins-
ci.org/browse/JENKINS-33846 ; feature for declarative pipelines planned:
https://issues.jenkins-ci.org/browse/JENKINS-45455 )
To Come:
• Multiple jenkins files
• More editor coverage of declaration syntax
• jenkins pipeline support for changelog and changesets with when keyword
• GitLab read/write support
• ...
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
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/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
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Docker Files:
https://github.com/jenkinsci/docker/blob/master/README.md
https://hub.docker.com/r/jenkinsci/blueocean/
Further references & information II
© 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com
Contact
Roman Pickl (@rompic)
roman.pickl@fluidtime.com
Fluidtime Data Services GmbH
Neubaugasse 12-14/25
A–1070 Wien
Tel +43 (0)1 5860 180
www.fluidtime.com
1 of 36

Recommended

Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern... by
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...Edureka!
939 views32 slides
Challenges of Kubernetes On-premise Deployment by
Challenges of Kubernetes On-premise DeploymentChallenges of Kubernetes On-premise Deployment
Challenges of Kubernetes On-premise DeploymentVietnam Open Infrastructure User Group
478 views23 slides
Vmware vSphere Api Best Practices by
Vmware vSphere Api Best PracticesVmware vSphere Api Best Practices
Vmware vSphere Api Best PracticesPablo Roesch
12.6K views32 slides
.NET Core, ASP.NET Core Course, Session 6 by
.NET Core, ASP.NET Core Course, Session 6.NET Core, ASP.NET Core Course, Session 6
.NET Core, ASP.NET Core Course, Session 6aminmesbahi
483 views37 slides
Azure Service Bus Queue API for Scala by
Azure Service Bus Queue API for ScalaAzure Service Bus Queue API for Scala
Azure Service Bus Queue API for ScalaBraja Krishna Das
871 views9 slides
Room 3 - 6 - Nguyễn Văn Thắng & Dzung Nguyen - Ứng dụng openzfs làm lưu trữ t... by
Room 3 - 6 - Nguyễn Văn Thắng & Dzung Nguyen - Ứng dụng openzfs làm lưu trữ t...Room 3 - 6 - Nguyễn Văn Thắng & Dzung Nguyen - Ứng dụng openzfs làm lưu trữ t...
Room 3 - 6 - Nguyễn Văn Thắng & Dzung Nguyen - Ứng dụng openzfs làm lưu trữ t...Vietnam Open Infrastructure User Group
379 views133 slides

More Related Content

What's hot

Docker, Linux Containers (LXC), and security by
Docker, Linux Containers (LXC), and securityDocker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and securityJérôme Petazzoni
51.7K views59 slides
Containers 101 by
Containers 101Containers 101
Containers 101Black Duck by Synopsys
2.4K views30 slides
Learning how AWS implement AWS VPC CNI by
Learning how AWS implement AWS VPC CNILearning how AWS implement AWS VPC CNI
Learning how AWS implement AWS VPC CNIHungWei Chiu
745 views65 slides
ASP.NET Core: The best of the new bits by
ASP.NET Core: The best of the new bitsASP.NET Core: The best of the new bits
ASP.NET Core: The best of the new bitsKen Cenerelli
1.6K views50 slides
Dot Net Core by
Dot Net CoreDot Net Core
Dot Net CoreAmir Barylko
2.5K views53 slides
Ibm web sphere application server interview questions by
Ibm web sphere application server interview questionsIbm web sphere application server interview questions
Ibm web sphere application server interview questionspraveen_guda
28.5K views10 slides

What's hot(20)

Docker, Linux Containers (LXC), and security by Jérôme Petazzoni
Docker, Linux Containers (LXC), and securityDocker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and security
Jérôme Petazzoni51.7K views
Learning how AWS implement AWS VPC CNI by HungWei Chiu
Learning how AWS implement AWS VPC CNILearning how AWS implement AWS VPC CNI
Learning how AWS implement AWS VPC CNI
HungWei Chiu745 views
ASP.NET Core: The best of the new bits by Ken Cenerelli
ASP.NET Core: The best of the new bitsASP.NET Core: The best of the new bits
ASP.NET Core: The best of the new bits
Ken Cenerelli1.6K views
Ibm web sphere application server interview questions by praveen_guda
Ibm web sphere application server interview questionsIbm web sphere application server interview questions
Ibm web sphere application server interview questions
praveen_guda28.5K views
virtualization and hypervisors by Gaurav Suri
virtualization and hypervisorsvirtualization and hypervisors
virtualization and hypervisors
Gaurav Suri42.3K views
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요 by Jo Hoon
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
Jo Hoon4.6K views
OVERVIEW: Chromium Source Tree by Chang W. Doh
OVERVIEW: Chromium Source TreeOVERVIEW: Chromium Source Tree
OVERVIEW: Chromium Source Tree
Chang W. Doh4.9K views
"Certified Kubernetes Administrator Exam – how it was" by Andrii Fedenishin by Katherine Golovinova
"Certified Kubernetes Administrator Exam – how it was" by Andrii Fedenishin"Certified Kubernetes Administrator Exam – how it was" by Andrii Fedenishin
"Certified Kubernetes Administrator Exam – how it was" by Andrii Fedenishin
Deploying your first application with Kubernetes by OVHcloud
Deploying your first application with KubernetesDeploying your first application with Kubernetes
Deploying your first application with Kubernetes
OVHcloud992 views
Introduction to kubernetes by Gabriel Carro
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
Gabriel Carro230 views
What is Virtualization and its types & Techniques.What is hypervisor and its ... by Shashi soni
What is Virtualization and its types & Techniques.What is hypervisor and its ...What is Virtualization and its types & Techniques.What is hypervisor and its ...
What is Virtualization and its types & Techniques.What is hypervisor and its ...
Shashi soni9.3K views

Similar to Continuous delivery with jenkins pipelines (@devfest Vienna)

Continuous delivery with jenkins pipelines incl. dev tools (@ Vienna DevOps &... by
Continuous delivery with jenkins pipelines incl. dev tools (@ Vienna DevOps &...Continuous delivery with jenkins pipelines incl. dev tools (@ Vienna DevOps &...
Continuous delivery with jenkins pipelines incl. dev tools (@ Vienna DevOps &...Roman Pickl
551 views31 slides
Continuous delivery with jenkins pipelines (@WeAreDevelopers2017) by
Continuous delivery with jenkins pipelines (@WeAreDevelopers2017)Continuous delivery with jenkins pipelines (@WeAreDevelopers2017)
Continuous delivery with jenkins pipelines (@WeAreDevelopers2017)Roman Pickl
911 views20 slides
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration by
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems IntegrationJenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems IntegrationOleg Nenashev
1.4K views66 slides
Continuous delivery with jenkins pipelines @ devdays by
Continuous delivery with jenkins pipelines  @ devdaysContinuous delivery with jenkins pipelines  @ devdays
Continuous delivery with jenkins pipelines @ devdaysRoman Pickl
691 views38 slides
DevConf 2017 - Realistic Container Platform Simulations by
DevConf 2017 - Realistic Container Platform SimulationsDevConf 2017 - Realistic Container Platform Simulations
DevConf 2017 - Realistic Container Platform SimulationsJeremy Eder
1K views28 slides
Containers and Microservices for Realists by
Containers and Microservices for RealistsContainers and Microservices for Realists
Containers and Microservices for RealistsOracle Developers
1.7K views70 slides

Similar to Continuous delivery with jenkins pipelines (@devfest Vienna)(20)

Continuous delivery with jenkins pipelines incl. dev tools (@ Vienna DevOps &... by Roman Pickl
Continuous delivery with jenkins pipelines incl. dev tools (@ Vienna DevOps &...Continuous delivery with jenkins pipelines incl. dev tools (@ Vienna DevOps &...
Continuous delivery with jenkins pipelines incl. dev tools (@ Vienna DevOps &...
Roman Pickl551 views
Continuous delivery with jenkins pipelines (@WeAreDevelopers2017) by Roman Pickl
Continuous delivery with jenkins pipelines (@WeAreDevelopers2017)Continuous delivery with jenkins pipelines (@WeAreDevelopers2017)
Continuous delivery with jenkins pipelines (@WeAreDevelopers2017)
Roman Pickl911 views
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration by Oleg Nenashev
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems IntegrationJenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Oleg Nenashev1.4K views
Continuous delivery with jenkins pipelines @ devdays by Roman Pickl
Continuous delivery with jenkins pipelines  @ devdaysContinuous delivery with jenkins pipelines  @ devdays
Continuous delivery with jenkins pipelines @ devdays
Roman Pickl691 views
DevConf 2017 - Realistic Container Platform Simulations by Jeremy Eder
DevConf 2017 - Realistic Container Platform SimulationsDevConf 2017 - Realistic Container Platform Simulations
DevConf 2017 - Realistic Container Platform Simulations
Jeremy Eder1K views
Containers and Microservices for Realists by Oracle Developers
Containers and Microservices for RealistsContainers and Microservices for Realists
Containers and Microservices for Realists
Oracle Developers1.7K views
Containers and microservices for realists by Karthik Gaekwad
Containers and microservices for realistsContainers and microservices for realists
Containers and microservices for realists
Karthik Gaekwad2.2K views
Build Your First SharePoint Framework Webpart by Eric Overfield
Build Your First SharePoint Framework WebpartBuild Your First SharePoint Framework Webpart
Build Your First SharePoint Framework Webpart
Eric Overfield1.3K views
What's New in Docker - February 2017 by Patrick Chanezon
What's New in Docker - February 2017What's New in Docker - February 2017
What's New in Docker - February 2017
Patrick Chanezon1.4K views
Continuous Code Quality with the sonar ecosystem by Roman Pickl
Continuous Code Quality with the sonar ecosystemContinuous Code Quality with the sonar ecosystem
Continuous Code Quality with the sonar ecosystem
Roman Pickl2.3K views
Continuous Code Quality with the Sonar Ecosystem @GeeCON 2017 in Prague by Roman Pickl
Continuous Code Quality with the Sonar Ecosystem @GeeCON 2017 in PragueContinuous Code Quality with the Sonar Ecosystem @GeeCON 2017 in Prague
Continuous Code Quality with the Sonar Ecosystem @GeeCON 2017 in Prague
Roman Pickl850 views
Real Time Streaming with Flink & Couchbase by Manuel Hurtado
Real Time Streaming with Flink & CouchbaseReal Time Streaming with Flink & Couchbase
Real Time Streaming with Flink & Couchbase
Manuel Hurtado883 views
Webinar: End-to-End CI/CD with GitLab and DC/OS by Mesosphere Inc.
Webinar: End-to-End CI/CD with GitLab and DC/OSWebinar: End-to-End CI/CD with GitLab and DC/OS
Webinar: End-to-End CI/CD with GitLab and DC/OS
Mesosphere Inc.1.5K views
Spark Pipelines in the Cloud with Alluxio with Gene Pang by Spark Summit
Spark Pipelines in the Cloud with Alluxio with Gene PangSpark Pipelines in the Cloud with Alluxio with Gene Pang
Spark Pipelines in the Cloud with Alluxio with Gene Pang
Spark Summit1.4K views
DevSecOps - Security in DevOps by Aarno Aukia
DevSecOps - Security in DevOpsDevSecOps - Security in DevOps
DevSecOps - Security in DevOps
Aarno Aukia146 views
Spark Pipelines in the Cloud with Alluxio by Alluxio, Inc.
Spark Pipelines in the Cloud with AlluxioSpark Pipelines in the Cloud with Alluxio
Spark Pipelines in the Cloud with Alluxio
Alluxio, Inc.630 views
Microservices & Serverless Architecture Principles Applied - Cisco Live Orlan... by Cisco DevNet
Microservices & Serverless Architecture Principles Applied - Cisco Live Orlan...Microservices & Serverless Architecture Principles Applied - Cisco Live Orlan...
Microservices & Serverless Architecture Principles Applied - Cisco Live Orlan...
Cisco DevNet309 views
Continuous Delivery: Fly the Friendly CI in Pivotal Cloud Foundry with Concourse by VMware Tanzu
Continuous Delivery: Fly the Friendly CI in Pivotal Cloud Foundry with ConcourseContinuous Delivery: Fly the Friendly CI in Pivotal Cloud Foundry with Concourse
Continuous Delivery: Fly the Friendly CI in Pivotal Cloud Foundry with Concourse
VMware Tanzu1.8K views

More from Roman Pickl

Are we really moving faster? How visualizing flow changed the way we work by
Are we really moving faster? How visualizing flow changed the way we workAre we really moving faster? How visualizing flow changed the way we work
Are we really moving faster? How visualizing flow changed the way we workRoman Pickl
4 views25 slides
Are we really moving faster? How visualizing flow changed the way we work by
Are we really moving faster? How visualizing flow changed the way we workAre we really moving faster? How visualizing flow changed the way we work
Are we really moving faster? How visualizing flow changed the way we workRoman Pickl
118 views24 slides
Are we really moving faster? How visualizing flow changed the way we work by
Are we really moving faster? How visualizing flow changed the way we workAre we really moving faster? How visualizing flow changed the way we work
Are we really moving faster? How visualizing flow changed the way we workRoman Pickl
271 views23 slides
Are we really moving faster? How visualizing flow changed the way we work - ... by
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 - ...Roman Pickl
134 views25 slides
Continuous delivery with jenkins pipelines @devopsdays cairo by
Continuous delivery with jenkins pipelines  @devopsdays cairoContinuous delivery with jenkins pipelines  @devopsdays cairo
Continuous delivery with jenkins pipelines @devopsdays cairoRoman Pickl
286 views33 slides
Continuous delivery with jenkins pipelines @devops pro moscow by
Continuous delivery with jenkins pipelines @devops pro moscow Continuous delivery with jenkins pipelines @devops pro moscow
Continuous delivery with jenkins pipelines @devops pro moscow Roman Pickl
268 views38 slides

More from Roman Pickl(6)

Are we really moving faster? How visualizing flow changed the way we work by Roman Pickl
Are we really moving faster? How visualizing flow changed the way we workAre 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
Roman Pickl4 views
Are we really moving faster? How visualizing flow changed the way we work by Roman Pickl
Are we really moving faster? How visualizing flow changed the way we workAre 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
Roman Pickl118 views
Are we really moving faster? How visualizing flow changed the way we work by Roman Pickl
Are we really moving faster? How visualizing flow changed the way we workAre 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
Roman Pickl271 views
Are we really moving faster? How visualizing flow changed the way we work - ... by Roman Pickl
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 - ...
Roman Pickl134 views
Continuous delivery with jenkins pipelines @devopsdays cairo by Roman Pickl
Continuous delivery with jenkins pipelines  @devopsdays cairoContinuous delivery with jenkins pipelines  @devopsdays cairo
Continuous delivery with jenkins pipelines @devopsdays cairo
Roman Pickl286 views
Continuous delivery with jenkins pipelines @devops pro moscow by Roman Pickl
Continuous delivery with jenkins pipelines @devops pro moscow Continuous delivery with jenkins pipelines @devops pro moscow
Continuous delivery with jenkins pipelines @devops pro moscow
Roman Pickl268 views

Recently uploaded

FIMA 2023 Neo4j & FS - Entity Resolution.pptx by
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptxNeo4j
7 views26 slides
Airline Booking Software by
Airline Booking SoftwareAirline Booking Software
Airline Booking SoftwareSharmiMehta
6 views26 slides
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -... by
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...Deltares
6 views15 slides
AI and Ml presentation .pptx by
AI and Ml presentation .pptxAI and Ml presentation .pptx
AI and Ml presentation .pptxFayazAli87
11 views15 slides
SUGCON ANZ Presentation V2.1 Final.pptx by
SUGCON ANZ Presentation V2.1 Final.pptxSUGCON ANZ Presentation V2.1 Final.pptx
SUGCON ANZ Presentation V2.1 Final.pptxJack Spektor
22 views34 slides
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with... by
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...sparkfabrik
5 views46 slides

Recently uploaded(20)

FIMA 2023 Neo4j & FS - Entity Resolution.pptx by Neo4j
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
Neo4j7 views
Airline Booking Software by SharmiMehta
Airline Booking SoftwareAirline Booking Software
Airline Booking Software
SharmiMehta6 views
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -... by Deltares
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...
Deltares6 views
AI and Ml presentation .pptx by FayazAli87
AI and Ml presentation .pptxAI and Ml presentation .pptx
AI and Ml presentation .pptx
FayazAli8711 views
SUGCON ANZ Presentation V2.1 Final.pptx by Jack Spektor
SUGCON ANZ Presentation V2.1 Final.pptxSUGCON ANZ Presentation V2.1 Final.pptx
SUGCON ANZ Presentation V2.1 Final.pptx
Jack Spektor22 views
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with... by sparkfabrik
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
sparkfabrik5 views
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ... by Deltares
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...
Deltares11 views
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t... by Deltares
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...
Deltares9 views
Copilot Prompting Toolkit_All Resources.pdf by Riccardo Zamana
Copilot Prompting Toolkit_All Resources.pdfCopilot Prompting Toolkit_All Resources.pdf
Copilot Prompting Toolkit_All Resources.pdf
Riccardo Zamana8 views
Myths and Facts About Hospice Care: Busting Common Misconceptions by Care Coordinations
Myths and Facts About Hospice Care: Busting Common MisconceptionsMyths and Facts About Hospice Care: Busting Common Misconceptions
Myths and Facts About Hospice Care: Busting Common Misconceptions
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action by Márton Kodok
Gen Apps on Google Cloud PaLM2 and Codey APIs in ActionGen Apps on Google Cloud PaLM2 and Codey APIs in Action
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action
Márton Kodok5 views
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium... by Lisi Hocke
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Lisi Hocke30 views
Navigating container technology for enhanced security by Niklas Saari by Metosin Oy
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas Saari
Metosin Oy14 views
DSD-INT 2023 Exploring flash flood hazard reduction in arid regions using a h... by Deltares
DSD-INT 2023 Exploring flash flood hazard reduction in arid regions using a h...DSD-INT 2023 Exploring flash flood hazard reduction in arid regions using a h...
DSD-INT 2023 Exploring flash flood hazard reduction in arid regions using a h...
Deltares5 views
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut... by Deltares
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...
Deltares7 views
DSD-INT 2023 Salt intrusion Modelling of the Lauwersmeer, towards a measureme... by Deltares
DSD-INT 2023 Salt intrusion Modelling of the Lauwersmeer, towards a measureme...DSD-INT 2023 Salt intrusion Modelling of the Lauwersmeer, towards a measureme...
DSD-INT 2023 Salt intrusion Modelling of the Lauwersmeer, towards a measureme...
Deltares5 views
Advanced API Mocking Techniques by Dimpy Adhikary
Advanced API Mocking TechniquesAdvanced API Mocking Techniques
Advanced API Mocking Techniques
Dimpy Adhikary19 views
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the... by Deltares
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...
DSD-INT 2023 Leveraging the results of a 3D hydrodynamic model to improve the...
Deltares6 views

Continuous delivery with jenkins pipelines (@devfest Vienna)

  • 1. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Continuous Delivery with Jenkins Pipelines (incl. Advanced Topics) Roman Pickl
  • 2. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com • 10+ years’ experience in integrating transport systems • 22 mobility Apps in the stores • 43+ million requests / month • 500.000+ unique users / month At a glance qando Vienna, Linz, Graz, Salzburg, Klagenfurt. SMILE Lighthouse project for integrated mobility Wien Mobil Lab Vienna FluidHub Powering the Integrated Mobility and MaaS Ecosystem 2009 avv connect Aachen Region, North Rhine-Westphalia. 2014 NUMO Vienna 2012 2015 2016
  • 3. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com How did I end up here? • Roman Pickl (@rompic) • CTO @ Fluidtime • In charge of the technical development • Uses Jenkins since 2012 • Loves CI/CD/DevOps • Here to learn
  • 4. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Continuous Delivery (CD) 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 Read these books! Jez Humble on Continuous Delivery(2012): https://www.youtube.com/watch?v=skLJuksCRTw
  • 5. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Deployment Pipelines (Let’s build it with jenkins) (Jez Humble D. F., Continuous Delivery: Reliable Software Releases Through Build, Test, and Deployment Automation, 2010)
  • 6. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Jenkins #1 Continuous Integration and Delivery server •Created by Kohsuke Kawaguchi •Initial Release 2005 (Hudson) •Open Source (MIT License) •Active and independent community (https://jenkins.io) •155,000 active installations •1,500+ 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 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/
  • 7. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Welcome Blue Ocean!
  • 8. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Create a Pipeline Wizard
  • 9. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com 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) https://jenkins.io/doc/book/pipeline/jenkinsfile/
  • 10. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Scripted vs. Declarative Scripted Pipelines: Declarative Pipeline: https://jenkins.io/doc/book/pipeline/syntax/
  • 11. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Scripted vs. Declarative Scripted Pipeline: Declarative Pipeline: https://jenkins.io/doc/book/pipeline/syntax/ • 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 pipelinesBoth: • 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. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com script Step • 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 https://jenkins.io/doc/book/pipeline/syntax/
  • 13. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Settings
  • 14. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Stages
  • 15. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Parallel Execution With declarative1.2
  • 16. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Approval ... Deploy to Stage, Deploy Live, Release omitted here
  • 17. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Post Build Notifications
  • 18. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Demo 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)
  • 19. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Blue Ocean 1.3.3 released 16.11.2017 • https://wiki.jenkins.io/display/JENKINS/Blue+Ocean+Plugin • Latest additions • JIRA integration • Declarative Pipeline version 1.2 support • Support of different Repositories Public roadmap https://jenkins.io/projects/blueocean/roadmap/
  • 20. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Overview
  • 21. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Approval
  • 22. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Detail
  • 23. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Multi branch support
  • 24. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Multi branch (When)
  • 25. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Pipeline Development and Advanced Tools • Blue Ocean Pipeline Editor • Snippet Generator • IntelliJ IDEA GDSL – Autocomplete • Command-line Pipeline Linter • Replay Feature • Unit Testing Jenkins Pipelines • Shared Libaries https://jenkins.io/doc/book/pipeline/development/ https://jenkins.io/doc/book/pipeline/shared-libraries/
  • 26. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Pipeline Editor GitLab currently not supported (planned! https://issues.jenkins-ci.org/browse/JENKINS-43148) Workaround: http://localhost:8080/blue/organizations/jenkins/pipeline-editor/ Ctrl-S / Cmd-S to open the load save dialog
  • 27. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Snippet generator http://localhost:8080/pipeline-syntax https://jenkins.io/doc/book/pipeline/getting-started/#snippet-generator
  • 28. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com IntelliJ IDEA GDSL - Autocomplete • Autocompletion of steps for scripted pipelines • Install Groovy Plugin • Download http://localhost:8080/pipeline-syntax/gdsl • Add it as e.g. pipeline.gdsl to your projects src path See https://st-g.de/2016/08/jenkins-pipeline-autocompletion-in-intellij https://stackoverflow.com/questions/41062514/use-gdsl-file-in-a-java-project-in-intellij https://stackoverflow.com/a/41149255/3165782 for setting it up.
  • 29. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Command-line Pipeline Linter Validate Declarative Pipelines from the cli before actually running it/checking it in. See https://jenkins.io/doc/book/pipeline/development/#linter for details. Remember to enable SSH access, expose a port on your docker container and add ssh key to try this!
  • 30. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Replay Feature • 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 https://jenkins.io/doc/book/pipeline/development/
  • 31. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Shared Libraries 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/shar ed-libraries/ and https://jenkins.io/blog/2017/10/02/pipe line-templates-with-shared-libraries/ for more details.
  • 32. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Unit Testing Jenkins Pipelines •Allows to unit test Pipelines and Shared Libraries before running them in full •Provides a mock execution environment that can be used to check for expected behavior •Still quite rough around the edges. (e.g. no support for declarative pipeline yet https://github.com/lesfurets/JenkinsPipelineUnit/pull/13) See: https://github.com/lesfurets/JenkinsPipelineUnit https://github.com/lesfurets/JenkinsPipelineUnit/blob/master/README.md https://issues.jenkins-ci.org/browse/JENKINS-33925
  • 33. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Things missing / Things to come Missing: • Support for definition of variables in declarative pipelines (see workaround in https://issues.jenkins-ci.org/browse/JENKINS-41335) • Keep build forever (https://issues.jenkins-ci.org/browse/JENKINS-39028 ; workaround via shared lib) • Restart stages for pipelines (checkpoint as commercial feature, https://issues.jenkins- ci.org/browse/JENKINS-33846 ; feature for declarative pipelines planned: https://issues.jenkins-ci.org/browse/JENKINS-45455 ) To Come: • Multiple jenkins files • More editor coverage of declaration syntax • jenkins pipeline support for changelog and changesets with when keyword • GitLab read/write support • ...
  • 34. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com 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/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
  • 35. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Docker Files: https://github.com/jenkinsci/docker/blob/master/README.md https://hub.docker.com/r/jenkinsci/blueocean/ Further references & information II
  • 36. © 2017 Copyright Fluidtime Data Services GmbH | www.fluidtime.com Contact Roman Pickl (@rompic) roman.pickl@fluidtime.com Fluidtime Data Services GmbH Neubaugasse 12-14/25 A–1070 Wien Tel +43 (0)1 5860 180 www.fluidtime.com