SlideShare a Scribd company logo
Moving from
Jenkins1 to 2
Is Jenkins
Declarative Pipeline
ready for real
work?
hello!
I am Frits van der Holst
Twitter: @FritsvanderH
or
nl.linkedin.com/in/fritsvanderholst/
“Jenkins Declarative Pipeline is
simple right?
Just Throw some together..
✘ Pull From GIT
✘ Build Maven job
✘ Publish and done.
The few easy steps are on the next slides..
pipeline {
agent any
tools {
maven 'Maven 3.3.9'
jdk 'jdk8'
}
stages {
stage ('Initialize') {
steps {
sh '''
echo "PATH = ${PATH}"
echo "M2_HOME = ${M2_HOME}"
'''
}
}
stage ('Build') {
steps {
It's Simple!
No… this is not my story
How about doing real and more difficult work..
GUI config Jenkins
Scripted Pipeline example
node('test') {
// compute complete workspace path, from current node to the allocated disk
exws(extWorkspace) {
try {
// run tests in the same workspace that the project was built
sh 'mvn test'
} catch (e) {
// if any exception occurs, mark the build as failed
currentBuild.result = 'FAILURE'
throw e
} finally {
// perform workspace cleanup only if the build have passed
// if the build has failed, the workspace will be kept
cleanWs cleanWhenFailure: false
}
}
}
Declarative Pipeline example
pipeline {
agent any
stages {
stage('Example') {
steps {
echo 'Hello World'
}
}
}
post {
always {
echo 'I will always say Hello again!'
}
}
}
Jenkins 'old' User Interface
Jenkins 'new' User Interface (blue ocean)
Many Simple Examples
✘ Lots of simple small fragments of declarative pipeline @ the web
○ Usually java/maven based
○ And very small fragments
✘ but..
✘ Pipelines get big and complex very quickly
✘ Does Declarative Pipeline scale?
✘ Not all plugins support a pipeline scripting interface..
Legacy
Multi language
During my career I mostly bump into that...
👴
HP-UX
Windows XP
Open VMS
Windows 7
SuseProfessional 9.3
Spot the OS I did not slave to a Jenkins server
Windows 2000
Windows NT
CentOS5
RedHat 3
Cmake, HelpAndManual, Java, GoogleTest,
Mercurial, C++, doxygen, Innosetup, Squish,
GCC, Python, Subversion, Swigwin, Groovy,
C#, LaTeX, LCOV, Junit, Cpack, VirtualEnv,
dSpace, Intel Fortran compiler, Nmake,
hgweb, innounpack, Cuda, Automake,
Simulink
Tool piles
Matlab, Scons, Ant, Boost, Nunit,
VS2008/12/15/17, Pyinstaller, NSIS, Git,
Valgrind, SecureTeam, Jom, PGI Fortran,
Cygwin, FMUchecker, Ctest, SvnKit,
Ranorex, Nexus, Ansible, Pylint, Cobertura,
QT3, FlexLM, Autotools, websvn, modular,
Docker
✘ Mixed teams (60 people)
○ SW developers
○ Mechanical / Math engineers
○ Matlab specialists
✘ Each team has one (or more)
tooling/cm dev´s
✘ Teams prior experience with build
servers is (was) Buildbot or just cron
jobs
✘ Team loves Python … not Java
CM team = One Man Army
✘ Simulation software
○ Requiring dedicated hardware
○ Simulations on raw iron
○ Dedicated test tooling
✘ Big:
○ SCM archives
○ Test sets
○ Test result sets
✘ Build and Test takes hours
✘ A Dev worked on Scripted pipeline for
the first team moving to Jenkins
○ Kept bumping our heads
○ (Jenkins) software felt too
unstable for pipeline usage.
✘ Decided to go for graph mode
○ Got builds running the way we
wanted
○ Shorter learning curve for team
○ Use templates for re-usable
jobs
We did try Scripted Pipeline
… 2 years ago
✘ Number of jobs grew quickly
○ Lots of test jobs added
○ Need for running all tests on all
branches
✘ So the pipelines got Big:
○ Next slide...
Big
Pipelines….
Need for better solutions for growing pipelines
✘ Test & release team complains having difficulty getting overview
✘ Products still have monolithic long serial builds that take hours
○ Need for splitting up in smaller steps possibly on
dedicated slaves/executors
○ Having sub-products available as artefacts
✘ Scaling up test efforts requires many more automated test steps
✘ For me maintaining templates is getting cumbersome
○ 'Old' and 'new' templates crop up for enabling release branches
to be re-build next to current trunks
○ Changes to build templates not easily visible to teams
Eyeing Declarative Pipeline
✘ Spring 2017 Cloudbees announced 1.0 Pipeline
○ Nice overview of pipeline using Blue Ocean interface
○ Cloudbees is pushing this as the main build declaration
interface
✘ Simpler syntax seems to appeal to the dev teams
○ Storing the jenkinsFile in code repository makes jenkins
definition part of the code (branch)
✘ Phase 1 Proof Of Concept rebuilding the build for one team in
Pipeline
Build Slave
Example Pipeline
Csource
ExtLib
Images
C#Source
Build
C Artefact1
Build
C#
sign
Artefact2
Test
A1 1x
& 2x
Pack
age
Test
A2
Installer
Test Slave
SCM repo
Build
or
test
Artefact
Full
pipeline
(Jenkins) Software used
✘ Jenkins Master 2.73 (Community Version)
✘ Pipeline Plugin 2.5
✘ Pipeline Declarative 1.2 (1.3.x just came out this week).
✘ Blue Ocean 2.3
Snippet generator
Use case: Shorten build environment setup time
✘ The current (old) build system clones all 4 repo's one by one.
○ Setting up build env of 15 Gb took 30 to 40 minutes.
(250.000 files)
○ In my Jenkins 1.6 implementation I could save some time
○ Trying to do incremental builds when possible but clean
Builds are needed often.
✘ Using HG/Mercurial tricks and parallelization to the max
○ Turn on caching and sharing.
○ Start all clones parallel to each other (since HG is a single
threaded application.
✘ Brought full checkout time down do 5 mins.
Starting The Pipeline
#!/usr/bin/env groovy
pipeline {
// Agent definition for whole pipe. General vs14 Windows build slave.
agent {
label "Windows && x64 && ${GENERATOR}"
}
// General config for build, timestamps and console coloring.
options {
timestamps()
buildDiscarder(logRotator(daysToKeepStr:'90', artifactDaysToKeepStr:'20'))
}
// Poll SCM every 5 minutes every work day.
triggers {
pollSCM('H/5 * * * 1-5')
}
properties( buildDiscarder(logRotator(artifactDaysToKeepStr: '5', artifactNumToKeepStr: '', daysToKeepStr: '15', numToKeepStr: '')) ])
Environment Build Slave (2)
Pipeline {
// Set environment for all steps.
// Spawn all tools here also
environment {
GROOVY_HOME = tool name: 'Groovy-3.3.0', type: 'hudson.plugins.groovy.GroovyInstallation'
CMAKE_HOME = tool name: 'Cmake3.7', type: 'com.cloudbees.jenkins.plugins.customtools.CustomTool'
PYTHON_HOME = tool name: 'Python4.1', type: 'com.cloudbees.jenkins.plugins.customtools.CustomTool'
MATLAB_VERSION = "${MATLAB_R2013B_HOME}"
BuildArch = 'win64'
} Manual Says:
tools {
Maven 'apache-maven-3.0.1'
}
First Step Env Prep
Pipeline {
stages {
stage('Prepare Env') {
steps {
echo 'determine if last build was successful'
script {
if(!hudson.model.Result.SUCCESS.equals(
currentBuild.rawBuild.getPreviousBuild()?.getResult())) {
env.LAST_BUILD_FAILED = "true"
bat "echo previous build FAILED"
}
else {
env.LAST_BUILD_FAILED = "false"
bat "echo previous build SUCCESS"
}
}
echo 'Setting up build dirs..'
bat 'mkdir vislibrary_build n exit 0'
Parallel checkoutPipeline {
stages {
// Check out stage.. parallel checkout of all repo's.
stage('Check Out') {
parallel {
stage ("CloneCsRepo") {
steps {
echo 'Now let us check out C#Repo'
// Use sleep time preventing different HG threads grab same log file name
sleep 9
checkout changelog: true, poll: true, scm: [$class: 'MercurialSCM',
clean: true, credentialsId: '', installation: 'HG Multibranch',
source: "http://hg.wdm.local/hg/CsRepo/", subdir: 'CsRepo']
}
}
stage ("CloneCRepo") {
steps {
echo 'Now let us check out C Repo'
sleep 15
checkout changelog: true, poll: true,
Failed to parse ...Testing_Pipeline2_TMFC/builds/174/changelog2.xml: '<?xml version="1.0" encoding="UTF-8"?>
<changesets>
JENKINS-43176
Parallel checkout using HG caching
Jenkins
Master
hg
cache
Jenkins Slave
Workspace
hg
cache
Update
Sync
Refs (.hg)
folder
Build Environment is setup
In the build pipeline the following is done:
✘ Tools installed
✘ Archives checked out
✘ Environment setup
Need some simple logic?
Pipeline {
stages {
stage ('name') {
step {
script {
switch(GENERATOR) {
case "vs9sp1":
MATLAB_VERSION = "${MATLAB_R2010BSP2_HOME}"
break;
case "vs11":
MATLAB_VERSION = "${MATLAB_R2010BSP2_HOME}"
break;
case "vs14":
MATLAB_VERSION = "${MATLAB_R2013B_HOME}"
break;
}
bat "Echo MATLAB_VERSION = ${MATLAB_VERSION}"
}
Use case2: Don't build C-repo if not needed
✘ The current (old) build system (incremental) builds all even if only
one repo is changed.
○ A common case is only changes in C# repo
○ Cannot rely on correct source change detection in building C
repo
○ Not executing a not needed C Repo build step saves 20 minutes
Smart
Bypass!
Detect changes in repo's
Pipeline {
stages {
stage('Did CRepo Change') {
when {
anyOf {
changeset "applications/**/*"
changeset "cmake_modules/**/*"
}
}
steps {
echo 'C Repo sources changed!'
script {
env.CRepo_IS_CHANGED = 'true'
}
}
}
Detect changes in repo's
Pipeline {
stages {
stage('Cmake Gen') {
when {
anyOf {
// Is CRepo already build?
environment name: 'CRepo_IS_BUILD', value: 'false' //no..
// Did the previous build fail?
environment name: 'LAST_BUILD_FAILED', value: 'true' //yes..
// CRepo changes
environment name: 'CRepo_IS_CHANGED', value: 'true' //yes..
}
}
steps {
echo 'Do incremental clean for C Repo'
Use case3: Have All tests in one job run
✘ Quite a number of tests require dedicated hardware servers
○ Doing traditional jenkins, these are all separate jobs
○ Number of tests on different slaves will increase significantly
○ All tests will have to run on all dev/stage branches
○ Number of jobs will explode doing this traditional Jenkins way
○ Developers testers should get precise feedback for each branch
Testing Parallel to build steps
Prepare: stash test files
Pipeline {
stages {
stage("Stash It") {
steps {
echo 'Stash unittest folder for testing at dedicated test server'
// Stash it for unit tests
stash includes: "Crepo_build/${BuildArch}_${GENERATOR}/unittests/**", name: 'unittests'
}
}
Un-stash test files and testPipeline {
stages {
stage ("Unit/RegressionTest") {
agent {
node {
label 'Test && Nvidia'
customWorkspace 'c:/j'
}
}
environment {
NUNIT_DIR = "${WORKSPACE}/libsrepo/NUnit-2.6.3/bin"
}
steps {
// Remove folder from previous unit tests run.
cleanWs(patterns: [[pattern: '*results.xml', type: 'INCLUDE']] )
unstash 'unittests'
echo 'running unit tests with graphics card'
// Run the actual unit tests.
bat '''
call set TESTROOTPATH=%%WORKSPACE:=/%%
Process combined test resultsPipeline {
post {
always {
unstash 'boosttests'
unstash 'regressiontestresult'
step([$class: 'JUnitResultArchiver', testResults: '**/reports/unittest_results.xml'])
step([$class: 'XUnitBuilder', testTimeMargin: '3000', thresholdMode: 1,
thresholds: [[$class: 'FailedThreshold', failureThreshold: '50' unstableThreshold: '30'],
[$class: 'SkippedThreshold', failureThreshold: '100', unstableThreshold: '50']],
tools: [[$class: 'BoostTestJunitHudsonTestType', deleteOutputFiles: true, failIfNotNew: true,
pattern: "*results.xml", skipNoTestFiles: false, stopProcessingIfError: false] ]])
step([$class: 'AnalysisPublisher', canRunOnFailed: true, healthy: '', unHealthy: ''])
step([$class: 'CoberturaPublisher', coberturaReportFile: '**/reports/coverageResult.xml',
failUnhealthy: false, failUnstable: false, onlyStable: false, zoomCoverageChart: false]
}
success {
emailext attachLog: ,
body: "${JOB_NAME} - Build # ${BUILD_NUMBER} - SUCCESS!!: nn Check console output at ….
Combined
test
results in
Blue Ocean
General Problems Annoyances
Using pipeline / Blue Ocean
✘ Slowness / crash browser on large log files
✘ Snippet generator generates Declarative pipeline and/or scripted
○ Two lists of 'steps' in generator
○ Some generated scripts do not work anymore
✘ Completeness of documentation
Blue Ocean and display of logs
Snippet generator list 1..
Snippet generator list ..... 2?
Conclusion
✘ Declarative pipeline is a much needed extension to Jenkins
✘ Functionality is stable
✘ Documentation spotty
✘ Blue Ocean interface is a great improvement
○ General slowness is worrying
✘ Cloudbees is continuing development
○ Approx every 2 to 3 months new functionality is released
✘ We should give CloudBees credit for releasing all this to the
community
thanks!
Any questions?
You can find me at
Twitter: @FritsvanderH
or
nl.linkedin.com/in/fritsvanderholst/
Credits
Special thanks to all the people who made and released
these awesome resources for free:
✘ Presentation template by SlidesCarnival
✘ Photographs by Unsplash
Ad

More Related Content

What's hot (20)

Building an Extensible, Resumable DSL on Top of Apache Groovy
Building an Extensible, Resumable DSL on Top of Apache GroovyBuilding an Extensible, Resumable DSL on Top of Apache Groovy
Building an Extensible, Resumable DSL on Top of Apache Groovy
jgcloudbees
 
Plone deployment made easy
Plone deployment made easyPlone deployment made easy
Plone deployment made easy
Kim Chee Leong
 
CloudOps CloudStack Budapest, 2014
CloudOps CloudStack Budapest, 2014CloudOps CloudStack Budapest, 2014
CloudOps CloudStack Budapest, 2014
CloudOps2005
 
Using Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsUsing Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and Jenkins
Micael Gallego
 
Gradle in 45min - JBCN2-16 version
Gradle in 45min - JBCN2-16 versionGradle in 45min - JBCN2-16 version
Gradle in 45min - JBCN2-16 version
Schalk Cronjé
 
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Chu-Siang Lai
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
Steffen Gebert
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
corehard_by
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdocker
Jaehwa Park
 
Golang Project Layout and Practice
Golang Project Layout and PracticeGolang Project Layout and Practice
Golang Project Layout and Practice
Bo-Yi Wu
 
Let's go HTTPS-only! - More Than Buying a Certificate
Let's go HTTPS-only! - More Than Buying a CertificateLet's go HTTPS-only! - More Than Buying a Certificate
Let's go HTTPS-only! - More Than Buying a Certificate
Steffen Gebert
 
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016:  Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...PuppetConf 2016:  Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
Puppet
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
Paul Chao
 
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
Puppet
 
Everything as a code
Everything as a codeEverything as a code
Everything as a code
Aleksandr Tarasov
 
Rest, sockets em golang
Rest, sockets em golangRest, sockets em golang
Rest, sockets em golang
jefferson Otoni Lima
 
JavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as codeJavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as code
Bert Jan Schrijver
 
JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具
謝 宗穎
 
Devoxx 17 - Swift server-side
Devoxx 17 - Swift server-sideDevoxx 17 - Swift server-side
Devoxx 17 - Swift server-side
Publicis Sapient Engineering
 
Live deployment, ci, drupal
Live deployment, ci, drupalLive deployment, ci, drupal
Live deployment, ci, drupal
Andrii Podanenko
 
Building an Extensible, Resumable DSL on Top of Apache Groovy
Building an Extensible, Resumable DSL on Top of Apache GroovyBuilding an Extensible, Resumable DSL on Top of Apache Groovy
Building an Extensible, Resumable DSL on Top of Apache Groovy
jgcloudbees
 
Plone deployment made easy
Plone deployment made easyPlone deployment made easy
Plone deployment made easy
Kim Chee Leong
 
CloudOps CloudStack Budapest, 2014
CloudOps CloudStack Budapest, 2014CloudOps CloudStack Budapest, 2014
CloudOps CloudStack Budapest, 2014
CloudOps2005
 
Using Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsUsing Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and Jenkins
Micael Gallego
 
Gradle in 45min - JBCN2-16 version
Gradle in 45min - JBCN2-16 versionGradle in 45min - JBCN2-16 version
Gradle in 45min - JBCN2-16 version
Schalk Cronjé
 
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Chu-Siang Lai
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
Steffen Gebert
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
corehard_by
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdocker
Jaehwa Park
 
Golang Project Layout and Practice
Golang Project Layout and PracticeGolang Project Layout and Practice
Golang Project Layout and Practice
Bo-Yi Wu
 
Let's go HTTPS-only! - More Than Buying a Certificate
Let's go HTTPS-only! - More Than Buying a CertificateLet's go HTTPS-only! - More Than Buying a Certificate
Let's go HTTPS-only! - More Than Buying a Certificate
Steffen Gebert
 
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016:  Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...PuppetConf 2016:  Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
Puppet
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
Paul Chao
 
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
Puppet
 
JavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as codeJavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as code
Bert Jan Schrijver
 
JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具
謝 宗穎
 
Live deployment, ci, drupal
Live deployment, ci, drupalLive deployment, ci, drupal
Live deployment, ci, drupal
Andrii Podanenko
 

Similar to Moving from Jenkins 1 to 2 declarative pipeline adventures (20)

The Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build ScriptThe Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build Script
Docker, Inc.
 
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los AngelesJenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Andy Pemberton
 
Jenkins days workshop pipelines - Eric Long
Jenkins days workshop  pipelines - Eric LongJenkins days workshop  pipelines - Eric Long
Jenkins days workshop pipelines - Eric Long
ericlongtx
 
Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
Steffen Gebert
 
Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015
Kurt Madel
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
William Stewart
 
Continuous Integration With Jenkins Docker SQL Server
Continuous Integration With Jenkins Docker SQL ServerContinuous Integration With Jenkins Docker SQL Server
Continuous Integration With Jenkins Docker SQL Server
Chris Adkin
 
Scaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceScaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container Service
Ben Hall
 
Dev ops meetup
Dev ops meetupDev ops meetup
Dev ops meetup
Bigdata Meetup Kochi
 
An Ensemble Core with Docker - Solving a Real Pain in the PaaS
An Ensemble Core with Docker - Solving a Real Pain in the PaaS An Ensemble Core with Docker - Solving a Real Pain in the PaaS
An Ensemble Core with Docker - Solving a Real Pain in the PaaS
Erik Osterman
 
Why Gradle?
Why Gradle?Why Gradle?
Why Gradle?
Peter Ledbrook
 
Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!
Roberto Franchini
 
Let's make it flow ... one way
Let's make it flow ... one wayLet's make it flow ... one way
Let's make it flow ... one way
Roberto Ciatti
 
Taming AEM deployments
Taming AEM deploymentsTaming AEM deployments
Taming AEM deployments
Jakub Wadolowski
 
introduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformintroduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraform
niyof97
 
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Eugene Yokota
 
Node.js at Joyent: Engineering for Production
Node.js at Joyent: Engineering for ProductionNode.js at Joyent: Engineering for Production
Node.js at Joyent: Engineering for Production
jclulow
 
Leveraging AI for Software Developer Productivity.pptx
Leveraging AI for Software Developer Productivity.pptxLeveraging AI for Software Developer Productivity.pptx
Leveraging AI for Software Developer Productivity.pptx
petabridge
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
RightScale
 
Making your app soar without a container manifest
Making your app soar without a container manifestMaking your app soar without a container manifest
Making your app soar without a container manifest
LibbySchulze
 
The Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build ScriptThe Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build Script
Docker, Inc.
 
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los AngelesJenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Andy Pemberton
 
Jenkins days workshop pipelines - Eric Long
Jenkins days workshop  pipelines - Eric LongJenkins days workshop  pipelines - Eric Long
Jenkins days workshop pipelines - Eric Long
ericlongtx
 
Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015
Kurt Madel
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
William Stewart
 
Continuous Integration With Jenkins Docker SQL Server
Continuous Integration With Jenkins Docker SQL ServerContinuous Integration With Jenkins Docker SQL Server
Continuous Integration With Jenkins Docker SQL Server
Chris Adkin
 
Scaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceScaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container Service
Ben Hall
 
An Ensemble Core with Docker - Solving a Real Pain in the PaaS
An Ensemble Core with Docker - Solving a Real Pain in the PaaS An Ensemble Core with Docker - Solving a Real Pain in the PaaS
An Ensemble Core with Docker - Solving a Real Pain in the PaaS
Erik Osterman
 
Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!
Roberto Franchini
 
Let's make it flow ... one way
Let's make it flow ... one wayLet's make it flow ... one way
Let's make it flow ... one way
Roberto Ciatti
 
introduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformintroduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraform
niyof97
 
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Eugene Yokota
 
Node.js at Joyent: Engineering for Production
Node.js at Joyent: Engineering for ProductionNode.js at Joyent: Engineering for Production
Node.js at Joyent: Engineering for Production
jclulow
 
Leveraging AI for Software Developer Productivity.pptx
Leveraging AI for Software Developer Productivity.pptxLeveraging AI for Software Developer Productivity.pptx
Leveraging AI for Software Developer Productivity.pptx
petabridge
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
RightScale
 
Making your app soar without a container manifest
Making your app soar without a container manifestMaking your app soar without a container manifest
Making your app soar without a container manifest
LibbySchulze
 
Ad

Recently uploaded (20)

Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Ad

Moving from Jenkins 1 to 2 declarative pipeline adventures

  • 3. hello! I am Frits van der Holst Twitter: @FritsvanderH or nl.linkedin.com/in/fritsvanderholst/
  • 5. Just Throw some together.. ✘ Pull From GIT ✘ Build Maven job ✘ Publish and done. The few easy steps are on the next slides..
  • 6. pipeline { agent any tools { maven 'Maven 3.3.9' jdk 'jdk8' } stages { stage ('Initialize') { steps { sh ''' echo "PATH = ${PATH}" echo "M2_HOME = ${M2_HOME}" ''' } } stage ('Build') { steps { It's Simple!
  • 7. No… this is not my story How about doing real and more difficult work..
  • 9. Scripted Pipeline example node('test') { // compute complete workspace path, from current node to the allocated disk exws(extWorkspace) { try { // run tests in the same workspace that the project was built sh 'mvn test' } catch (e) { // if any exception occurs, mark the build as failed currentBuild.result = 'FAILURE' throw e } finally { // perform workspace cleanup only if the build have passed // if the build has failed, the workspace will be kept cleanWs cleanWhenFailure: false } } }
  • 10. Declarative Pipeline example pipeline { agent any stages { stage('Example') { steps { echo 'Hello World' } } } post { always { echo 'I will always say Hello again!' } } }
  • 11. Jenkins 'old' User Interface
  • 12. Jenkins 'new' User Interface (blue ocean)
  • 13. Many Simple Examples ✘ Lots of simple small fragments of declarative pipeline @ the web ○ Usually java/maven based ○ And very small fragments ✘ but.. ✘ Pipelines get big and complex very quickly ✘ Does Declarative Pipeline scale? ✘ Not all plugins support a pipeline scripting interface..
  • 14. Legacy Multi language During my career I mostly bump into that... 👴
  • 15. HP-UX Windows XP Open VMS Windows 7 SuseProfessional 9.3 Spot the OS I did not slave to a Jenkins server Windows 2000 Windows NT CentOS5 RedHat 3
  • 16. Cmake, HelpAndManual, Java, GoogleTest, Mercurial, C++, doxygen, Innosetup, Squish, GCC, Python, Subversion, Swigwin, Groovy, C#, LaTeX, LCOV, Junit, Cpack, VirtualEnv, dSpace, Intel Fortran compiler, Nmake, hgweb, innounpack, Cuda, Automake, Simulink Tool piles Matlab, Scons, Ant, Boost, Nunit, VS2008/12/15/17, Pyinstaller, NSIS, Git, Valgrind, SecureTeam, Jom, PGI Fortran, Cygwin, FMUchecker, Ctest, SvnKit, Ranorex, Nexus, Ansible, Pylint, Cobertura, QT3, FlexLM, Autotools, websvn, modular, Docker
  • 17. ✘ Mixed teams (60 people) ○ SW developers ○ Mechanical / Math engineers ○ Matlab specialists ✘ Each team has one (or more) tooling/cm dev´s ✘ Teams prior experience with build servers is (was) Buildbot or just cron jobs ✘ Team loves Python … not Java CM team = One Man Army ✘ Simulation software ○ Requiring dedicated hardware ○ Simulations on raw iron ○ Dedicated test tooling ✘ Big: ○ SCM archives ○ Test sets ○ Test result sets ✘ Build and Test takes hours
  • 18. ✘ A Dev worked on Scripted pipeline for the first team moving to Jenkins ○ Kept bumping our heads ○ (Jenkins) software felt too unstable for pipeline usage. ✘ Decided to go for graph mode ○ Got builds running the way we wanted ○ Shorter learning curve for team ○ Use templates for re-usable jobs We did try Scripted Pipeline … 2 years ago ✘ Number of jobs grew quickly ○ Lots of test jobs added ○ Need for running all tests on all branches ✘ So the pipelines got Big: ○ Next slide...
  • 20. Need for better solutions for growing pipelines ✘ Test & release team complains having difficulty getting overview ✘ Products still have monolithic long serial builds that take hours ○ Need for splitting up in smaller steps possibly on dedicated slaves/executors ○ Having sub-products available as artefacts ✘ Scaling up test efforts requires many more automated test steps ✘ For me maintaining templates is getting cumbersome ○ 'Old' and 'new' templates crop up for enabling release branches to be re-build next to current trunks ○ Changes to build templates not easily visible to teams
  • 21. Eyeing Declarative Pipeline ✘ Spring 2017 Cloudbees announced 1.0 Pipeline ○ Nice overview of pipeline using Blue Ocean interface ○ Cloudbees is pushing this as the main build declaration interface ✘ Simpler syntax seems to appeal to the dev teams ○ Storing the jenkinsFile in code repository makes jenkins definition part of the code (branch) ✘ Phase 1 Proof Of Concept rebuilding the build for one team in Pipeline
  • 22. Build Slave Example Pipeline Csource ExtLib Images C#Source Build C Artefact1 Build C# sign Artefact2 Test A1 1x & 2x Pack age Test A2 Installer Test Slave SCM repo Build or test Artefact
  • 24. (Jenkins) Software used ✘ Jenkins Master 2.73 (Community Version) ✘ Pipeline Plugin 2.5 ✘ Pipeline Declarative 1.2 (1.3.x just came out this week). ✘ Blue Ocean 2.3
  • 26. Use case: Shorten build environment setup time ✘ The current (old) build system clones all 4 repo's one by one. ○ Setting up build env of 15 Gb took 30 to 40 minutes. (250.000 files) ○ In my Jenkins 1.6 implementation I could save some time ○ Trying to do incremental builds when possible but clean Builds are needed often. ✘ Using HG/Mercurial tricks and parallelization to the max ○ Turn on caching and sharing. ○ Start all clones parallel to each other (since HG is a single threaded application. ✘ Brought full checkout time down do 5 mins.
  • 27. Starting The Pipeline #!/usr/bin/env groovy pipeline { // Agent definition for whole pipe. General vs14 Windows build slave. agent { label "Windows && x64 && ${GENERATOR}" } // General config for build, timestamps and console coloring. options { timestamps() buildDiscarder(logRotator(daysToKeepStr:'90', artifactDaysToKeepStr:'20')) } // Poll SCM every 5 minutes every work day. triggers { pollSCM('H/5 * * * 1-5') } properties( buildDiscarder(logRotator(artifactDaysToKeepStr: '5', artifactNumToKeepStr: '', daysToKeepStr: '15', numToKeepStr: '')) ])
  • 28. Environment Build Slave (2) Pipeline { // Set environment for all steps. // Spawn all tools here also environment { GROOVY_HOME = tool name: 'Groovy-3.3.0', type: 'hudson.plugins.groovy.GroovyInstallation' CMAKE_HOME = tool name: 'Cmake3.7', type: 'com.cloudbees.jenkins.plugins.customtools.CustomTool' PYTHON_HOME = tool name: 'Python4.1', type: 'com.cloudbees.jenkins.plugins.customtools.CustomTool' MATLAB_VERSION = "${MATLAB_R2013B_HOME}" BuildArch = 'win64' } Manual Says: tools { Maven 'apache-maven-3.0.1' }
  • 29. First Step Env Prep Pipeline { stages { stage('Prepare Env') { steps { echo 'determine if last build was successful' script { if(!hudson.model.Result.SUCCESS.equals( currentBuild.rawBuild.getPreviousBuild()?.getResult())) { env.LAST_BUILD_FAILED = "true" bat "echo previous build FAILED" } else { env.LAST_BUILD_FAILED = "false" bat "echo previous build SUCCESS" } } echo 'Setting up build dirs..' bat 'mkdir vislibrary_build n exit 0'
  • 30. Parallel checkoutPipeline { stages { // Check out stage.. parallel checkout of all repo's. stage('Check Out') { parallel { stage ("CloneCsRepo") { steps { echo 'Now let us check out C#Repo' // Use sleep time preventing different HG threads grab same log file name sleep 9 checkout changelog: true, poll: true, scm: [$class: 'MercurialSCM', clean: true, credentialsId: '', installation: 'HG Multibranch', source: "http://hg.wdm.local/hg/CsRepo/", subdir: 'CsRepo'] } } stage ("CloneCRepo") { steps { echo 'Now let us check out C Repo' sleep 15 checkout changelog: true, poll: true, Failed to parse ...Testing_Pipeline2_TMFC/builds/174/changelog2.xml: '<?xml version="1.0" encoding="UTF-8"?> <changesets> JENKINS-43176
  • 31. Parallel checkout using HG caching Jenkins Master hg cache Jenkins Slave Workspace hg cache Update Sync Refs (.hg) folder
  • 32. Build Environment is setup In the build pipeline the following is done: ✘ Tools installed ✘ Archives checked out ✘ Environment setup
  • 33. Need some simple logic? Pipeline { stages { stage ('name') { step { script { switch(GENERATOR) { case "vs9sp1": MATLAB_VERSION = "${MATLAB_R2010BSP2_HOME}" break; case "vs11": MATLAB_VERSION = "${MATLAB_R2010BSP2_HOME}" break; case "vs14": MATLAB_VERSION = "${MATLAB_R2013B_HOME}" break; } bat "Echo MATLAB_VERSION = ${MATLAB_VERSION}" }
  • 34. Use case2: Don't build C-repo if not needed ✘ The current (old) build system (incremental) builds all even if only one repo is changed. ○ A common case is only changes in C# repo ○ Cannot rely on correct source change detection in building C repo ○ Not executing a not needed C Repo build step saves 20 minutes
  • 36. Detect changes in repo's Pipeline { stages { stage('Did CRepo Change') { when { anyOf { changeset "applications/**/*" changeset "cmake_modules/**/*" } } steps { echo 'C Repo sources changed!' script { env.CRepo_IS_CHANGED = 'true' } } }
  • 37. Detect changes in repo's Pipeline { stages { stage('Cmake Gen') { when { anyOf { // Is CRepo already build? environment name: 'CRepo_IS_BUILD', value: 'false' //no.. // Did the previous build fail? environment name: 'LAST_BUILD_FAILED', value: 'true' //yes.. // CRepo changes environment name: 'CRepo_IS_CHANGED', value: 'true' //yes.. } } steps { echo 'Do incremental clean for C Repo'
  • 38. Use case3: Have All tests in one job run ✘ Quite a number of tests require dedicated hardware servers ○ Doing traditional jenkins, these are all separate jobs ○ Number of tests on different slaves will increase significantly ○ All tests will have to run on all dev/stage branches ○ Number of jobs will explode doing this traditional Jenkins way ○ Developers testers should get precise feedback for each branch
  • 39. Testing Parallel to build steps
  • 40. Prepare: stash test files Pipeline { stages { stage("Stash It") { steps { echo 'Stash unittest folder for testing at dedicated test server' // Stash it for unit tests stash includes: "Crepo_build/${BuildArch}_${GENERATOR}/unittests/**", name: 'unittests' } }
  • 41. Un-stash test files and testPipeline { stages { stage ("Unit/RegressionTest") { agent { node { label 'Test && Nvidia' customWorkspace 'c:/j' } } environment { NUNIT_DIR = "${WORKSPACE}/libsrepo/NUnit-2.6.3/bin" } steps { // Remove folder from previous unit tests run. cleanWs(patterns: [[pattern: '*results.xml', type: 'INCLUDE']] ) unstash 'unittests' echo 'running unit tests with graphics card' // Run the actual unit tests. bat ''' call set TESTROOTPATH=%%WORKSPACE:=/%%
  • 42. Process combined test resultsPipeline { post { always { unstash 'boosttests' unstash 'regressiontestresult' step([$class: 'JUnitResultArchiver', testResults: '**/reports/unittest_results.xml']) step([$class: 'XUnitBuilder', testTimeMargin: '3000', thresholdMode: 1, thresholds: [[$class: 'FailedThreshold', failureThreshold: '50' unstableThreshold: '30'], [$class: 'SkippedThreshold', failureThreshold: '100', unstableThreshold: '50']], tools: [[$class: 'BoostTestJunitHudsonTestType', deleteOutputFiles: true, failIfNotNew: true, pattern: "*results.xml", skipNoTestFiles: false, stopProcessingIfError: false] ]]) step([$class: 'AnalysisPublisher', canRunOnFailed: true, healthy: '', unHealthy: '']) step([$class: 'CoberturaPublisher', coberturaReportFile: '**/reports/coverageResult.xml', failUnhealthy: false, failUnstable: false, onlyStable: false, zoomCoverageChart: false] } success { emailext attachLog: , body: "${JOB_NAME} - Build # ${BUILD_NUMBER} - SUCCESS!!: nn Check console output at ….
  • 44. General Problems Annoyances Using pipeline / Blue Ocean ✘ Slowness / crash browser on large log files ✘ Snippet generator generates Declarative pipeline and/or scripted ○ Two lists of 'steps' in generator ○ Some generated scripts do not work anymore ✘ Completeness of documentation
  • 45. Blue Ocean and display of logs
  • 48. Conclusion ✘ Declarative pipeline is a much needed extension to Jenkins ✘ Functionality is stable ✘ Documentation spotty ✘ Blue Ocean interface is a great improvement ○ General slowness is worrying ✘ Cloudbees is continuing development ○ Approx every 2 to 3 months new functionality is released ✘ We should give CloudBees credit for releasing all this to the community
  • 49. thanks! Any questions? You can find me at Twitter: @FritsvanderH or nl.linkedin.com/in/fritsvanderholst/
  • 50. Credits Special thanks to all the people who made and released these awesome resources for free: ✘ Presentation template by SlidesCarnival ✘ Photographs by Unsplash

Editor's Notes

  • #9: Serialization Try catch Java / Groovy specifics.
  • #10: Serialization Try catch Java / Groovy specifics.
  • #23: Obviscated Based on a real pipeline. Tool version numbers.. names might be wrong
  • #27: File system is virtual
  • #29: Not added to Path!!
  • #30: Elevation!
  • #31: 1.2 syntax
  • #32: 1.2 syntax 13 Gb vs 26Gb
  • #34: Direct manipulation of env vars. No external groovy script running.
  • #36: 1.2 pipeline Announced at Jw 2017 Does not work with paralell.
  • #41: More efficient than making zip's your self No unwanted artefacts anymore.
  • #42: Stash results
  • #43: Stash results