SlideShare ist ein Scribd-Unternehmen logo
1 von 36
Downloaden Sie, um offline zu lesen
© 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

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Jenkins
JenkinsJenkins
Jenkins
 
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
 
Installing and Configuring NGINX Open Source
Installing and Configuring NGINX Open SourceInstalling and Configuring NGINX Open Source
Installing and Configuring NGINX Open Source
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Red Hat OpenShift Container Platform Overview
Red Hat OpenShift Container Platform OverviewRed Hat OpenShift Container Platform Overview
Red Hat OpenShift Container Platform Overview
 
Kubernetes Security
Kubernetes SecurityKubernetes Security
Kubernetes Security
 
Low Code Integration with Apache Camel.pdf
Low Code Integration with Apache Camel.pdfLow Code Integration with Apache Camel.pdf
Low Code Integration with Apache Camel.pdf
 
Managing APIs with MuleSoft
Managing APIs with MuleSoftManaging APIs with MuleSoft
Managing APIs with MuleSoft
 
Deep Dive - Infrastructure as Code
Deep Dive - Infrastructure as CodeDeep Dive - Infrastructure as Code
Deep Dive - Infrastructure as Code
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Docker Networking Overview
Docker Networking OverviewDocker Networking Overview
Docker Networking Overview
 
Containers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red HatContainers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red Hat
 
Jenkins tutorial
Jenkins tutorialJenkins tutorial
Jenkins tutorial
 
stupid-simple-kubernetes-final.pdf
stupid-simple-kubernetes-final.pdfstupid-simple-kubernetes-final.pdf
stupid-simple-kubernetes-final.pdf
 
WebLogic Scripting Tool Overview
WebLogic Scripting Tool OverviewWebLogic Scripting Tool Overview
WebLogic Scripting Tool Overview
 
Helm - Application deployment management for Kubernetes
Helm - Application deployment management for KubernetesHelm - Application deployment management for Kubernetes
Helm - Application deployment management for Kubernetes
 
Kubernetes Application Deployment with Helm - A beginner Guide!
Kubernetes Application Deployment with Helm - A beginner Guide!Kubernetes Application Deployment with Helm - A beginner Guide!
Kubernetes Application Deployment with Helm - A beginner Guide!
 
CNCF Meetup - OpenShift Overview
CNCF Meetup - OpenShift OverviewCNCF Meetup - OpenShift Overview
CNCF Meetup - OpenShift Overview
 

Ähnlich wie Continuous delivery with jenkins pipelines (@devfest Vienna)

Spark Pipelines in the Cloud with Alluxio with Gene Pang
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 Summit
 
Unconference Round Table Notes
Unconference Round Table NotesUnconference Round Table Notes
Unconference Round Table Notes
Timothy Spann
 

Ähnlich wie Continuous delivery with jenkins pipelines (@devfest Vienna) (20)

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 &...
Continuous delivery with jenkins pipelines incl. dev tools (@ Vienna DevOps &...
 
Continuous delivery with jenkins pipelines (@WeAreDevelopers2017)
Continuous delivery with jenkins pipelines (@WeAreDevelopers2017)Continuous delivery with jenkins pipelines (@WeAreDevelopers2017)
Continuous delivery with jenkins pipelines (@WeAreDevelopers2017)
 
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
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
 
Continuous delivery with jenkins pipelines @ devdays
Continuous delivery with jenkins pipelines  @ devdaysContinuous delivery with jenkins pipelines  @ devdays
Continuous delivery with jenkins pipelines @ devdays
 
DevConf 2017 - Realistic Container Platform Simulations
DevConf 2017 - Realistic Container Platform SimulationsDevConf 2017 - Realistic Container Platform Simulations
DevConf 2017 - Realistic Container Platform Simulations
 
Containers and Microservices for Realists
Containers and Microservices for RealistsContainers and Microservices for Realists
Containers and Microservices for Realists
 
Containers and microservices for realists
Containers and microservices for realistsContainers and microservices for realists
Containers and microservices for realists
 
Build Your First SharePoint Framework Webpart
Build Your First SharePoint Framework WebpartBuild Your First SharePoint Framework Webpart
Build Your First SharePoint Framework Webpart
 
What's New in Docker - February 2017
What's New in Docker - February 2017What's New in Docker - February 2017
What's New in Docker - February 2017
 
Continuous Code Quality with the sonar ecosystem
Continuous Code Quality with the sonar ecosystemContinuous Code Quality with the sonar ecosystem
Continuous Code Quality with the sonar ecosystem
 
EVOLVE'14 | Enhance | Anshul Chhabra & Akhil Aggrawal | Cisco - AEM High Avai...
EVOLVE'14 | Enhance | Anshul Chhabra & Akhil Aggrawal | Cisco - AEM High Avai...EVOLVE'14 | Enhance | Anshul Chhabra & Akhil Aggrawal | Cisco - AEM High Avai...
EVOLVE'14 | Enhance | Anshul Chhabra & Akhil Aggrawal | Cisco - AEM High Avai...
 
Continuous Code Quality with the Sonar Ecosystem @GeeCON 2017 in Prague
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
 
Securing DevOps
Securing DevOpsSecuring DevOps
Securing DevOps
 
Real Time Streaming with Flink & Couchbase
Real Time Streaming with Flink & CouchbaseReal Time Streaming with Flink & Couchbase
Real Time Streaming with Flink & Couchbase
 
Webinar: End-to-End CI/CD with GitLab and DC/OS
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
 
Spark Pipelines in the Cloud with Alluxio with Gene Pang
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
 
DevSecOps - Security in DevOps
DevSecOps - Security in DevOpsDevSecOps - Security in DevOps
DevSecOps - Security in DevOps
 
Spark Pipelines in the Cloud with Alluxio
Spark Pipelines in the Cloud with AlluxioSpark Pipelines in the Cloud with Alluxio
Spark Pipelines in the Cloud with Alluxio
 
Unconference Round Table Notes
Unconference Round Table NotesUnconference Round Table Notes
Unconference Round Table Notes
 
Microservices & Serverless Architecture Principles Applied - Cisco Live Orlan...
Microservices & Serverless Architecture Principles Applied - Cisco Live Orlan...Microservices & Serverless Architecture Principles Applied - Cisco Live Orlan...
Microservices & Serverless Architecture Principles Applied - Cisco Live Orlan...
 

Mehr von Roman Pickl

Mehr von Roman Pickl (6)

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 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
 
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 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
 
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 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
 
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 delivery with jenkins pipelines @devopsdays cairo
Continuous delivery with jenkins pipelines  @devopsdays cairoContinuous delivery with jenkins pipelines  @devopsdays cairo
Continuous delivery with jenkins pipelines @devopsdays cairo
 
Continuous delivery with jenkins pipelines @devops pro moscow
Continuous delivery with jenkins pipelines @devops pro moscow Continuous delivery with jenkins pipelines @devops pro moscow
Continuous delivery with jenkins pipelines @devops pro moscow
 

Kürzlich hochgeladen

Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Kürzlich hochgeladen (20)

tonesoftg
tonesoftgtonesoftg
tonesoftg
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 

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