SlideShare a Scribd company logo
©	2016	CloudBees,	Inc.		All	Rights	Reserved
©	2016	CloudBees,	Inc.		All	Rights	Reserved
©	2016	CloudBees,	Inc.		All	Rights	Reserved
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Continuous Delivery as Code
Pipeline and Jenkins 2
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Continuous Delivery
Continuous delivery (CD) is a software engineering approach in
which teams produce software in short cycles, ensuring that
the software can be reliably released at any time. It aims at
building, testing, and releasing software faster and more
frequently. The approach helps reduce the cost, time, and risk
of delivering changes by allowing for more incremental
updates to applications in production. A straightforward and
repeatable deployment process is important for continuous
delivery.
https://en.wikipedia.org/wiki/Continuous_delivery
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Meet Jenkins 2
jenkins.io/2.0
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Jenkins 2 Themes
Pipeline as code: front and center
Improved “out of the box” user
experience
User interface improvements
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Jenkins 2 Themes
Pipeline as code: front and center
Improved “out of the box” user
experience
User interface improvements
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Pipeline as code
• Introduce “Pipeline” as a new type in Jenkins
• Codify an implicit series of stages into an explicit
pipeline definition (Jenkinsfile) in source control
• Resumability/durability of pipeline state
• Extend the DSL to meet organizational needs
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Creating a Pipeline
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Creating a Pipeline
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Creating a Pipeline
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Creating a Pipeline
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Jenkinsfile
node('java8')	{	
stage('Checkout')	{	
checkout	scm	
}	
stage('Build')	{	
sh	'mvn	clean	install'	
}	
stage('Test')	{	
sh	'mvn	test'	
}	
archiveArtifacts	artifacts:	'target/**/*.jar',	fingerprint:	true	
}
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Pipeline Documentation
jenkins.io/doc
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Pipeline Documentation
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Snippet Generator localhost:8080/job/niagara/pipeline-syntax
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Snippet Generator localhost:8080/job/niagara/pipeline-syntax
©	2016	CloudBees,	Inc.		All	Rights	Reserved
DSL Reference localhost:8080/job/niagara/pipeline-syntax/html
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Pipeline Plugins
Extending Pipeline
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Pipeline Stage View plugin
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Pipeline Multibranch plugin
• Represent pipelines for multiple branches in one "Folder"
• Automatically scan a repository for each branch which contains a
Jenkinsfile
©	2016	CloudBees,	Inc.		All	Rights	Reserved
GitHub Organization Folder plugin
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Blue Ocean jenkins.io/projects/blueocean
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Docker Pipeline plugin
def	imageName	=	'jenkinsciinfra/bind'



node('docker')	{

	 checkout	scm

//	Compute	a	unique	image	tag

	 def	imageTag	=	"build-${env.BUILD_NUMBER}"

//	The	`docker`	variable	introduced	by	the	plugin

	 stage('Build')	{

	 	 def	whale	=	docker.build("${imageName}:${imageTag}")	
}

//	Publish	this	image	to	Docker	Hub

	 stage('Deploy')	{

	 	 whale.push()	
}	
}
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Docker Pipeline plugin
node('docker')	{	
//	The	`docker`	variable	introduced	by	the	plugin.	
//	
//	Invoking	our	Gradle	build	inside	a	freshly	spun	up	
//	Docker	container	with	JDK8	
docker.image('openjdk:8-jdk').inside	{	
	 checkout	scm	
	 sh	'./gradlew	--info'	
	 archiveArtifacts	artifacts:	'build/libs/**/*.jar',	fingerprint:	true	
}	
}
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Integration with existing plugins
Pipeline + ??? = Profit.
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Plugins that support Pipeline
• A few plugins which provide custom steps for Pipeline scripts:
– Tooling: Credentials binding, SSH Agent, Parallel Test
– Reporters: JUnit, Brakeman, HTML Publisher, Cucumber Test Result
– Notifiers: Slack, HipChat, email-ext
– Wrappers: Timestamper
• Plugins work within Pipelines
– SCM: Git, SVN, Mercurial, P4, CVS
– Wrappers: Ansi Color, NodeJS
– Build steps: Ant, etc
• More defined in COMPATIBILITY.md
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Steps added by plugins
node	{	
	 /*	other	work	happened	up	here	*/	
	 timestamps	{	
	 	 sh	'mvn	clean	package'	
	 	 junit	'**/target/surefire-reports/*.xml'	
	 }	
if	(env.BRANCH_NAME	==	'master')	{	
sshagent(credentials:	['my-credential-id'])	{	
	 sh	'./run-ssh-deploy-script'	
	 	 }	
	 }	
}
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Build Steps
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Build Wrappers
github.com/jenkinsci/pipeline-examples
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Abstracting Pipeline
Sharing code, best practices and templates for success
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Pipeline Shared Libraries
//	The	call()	method	in	any	file	in	pipeline-library.git/vars	is	exposed	as	a

//	method	with	the	same	name	as	the	file.

def	call(def	mavenOptions)	{	
docker.image('maven').inside	{	
	 timestamps	{	
	 sh	"mvn	clean	install	-Dmaven.test.failure.ignore=true	$
{mavenOptions}"	
}	
junit	'**/target/surefire-reports/**/*.xml'	
}

}
runMaven.groovy
github.com/jenkinsci/pipeline-examples
©	2016	CloudBees,	Inc.		All	Rights	Reserved
node	{	
	 checkout	scm	
	 stage('Build')	{	
//	Loads	runMaven	step	from	the	Shared	Library	and	invokes	it.	
	 	 runMaven	
	 }	
	 stage('Acceptance	Tests')	{	
	 	 git	'git://git.example.com/selenium-tests.git'	
	 	 sh	'./run-selenium.sh'	
	 }	
	 stage('Deploy')	{	
	 	 sh	'./deploy.sh'	
	 }	
}
Pipeline Shared Libraries
Jenkinsfile
github.com/jenkinsci/pipeline-examples
©	2016	CloudBees,	Inc.		All	Rights	Reserved
load step
//	Methods	in	this	file	will	end	up	as	
object	methods	on	the	object	that	load	
returns.

def	lookAtThis(String	whoAreYou)	{

				echo	"Look	at	this,	${whoAreYou}!	You	
loaded	something	from	another	file!"

}	
externalMethod.groovy
github.com/jenkinsci/pipeline-examples
//	If	there's	a	call	method,	you	can	just	
load	the	file,	say,	as	"foo",	and	then	
invoke	that	call	method	with	foo(...)	

def	call(String	whoAreYou)	{

				echo	"${whoAreYou},	say	thanks	to	the	
call(...)	method."

}	
externalCall.groovy
node	{	
		//	Load	the	file	from	the	current	
directory,	
		//	into	a	variable	called	"externalMethod"	
		def	externalMethod	=	
load("externalMethod.groovy")



		//	Call	the	method	we	defined

		externalMethod.lookAtThis("Steve")



		//	Now	load	'externalCall.groovy'.

		def	externalCall	=	
load("externalCall.groovy")



		//	We	can	just	run	it	with	
`externalCall()`

		externalCall("Steve")

}	
Jenkinsfile
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Continuous Delivery as Code
Final Thoughts
©	2016	CloudBees,	Inc.		All	Rights	Reserved
• A new pipeline “type” has been introduced
• Previously implicit pipelines, chained jobs, can now be
made explicit and committed to SCM
• Pipelines have state associated with them and can be
resumed
• It’s code. It can be modified and extended
Final Thoughts
©	2016	CloudBees,	Inc.		All	Rights	Reserved
©	2016	CloudBees,	Inc.		All	Rights	Reserved
Questions/Answers
jenkins.io/2.0
jenkins.io/doc
@jenkinsci

More Related Content

PDF
Distributed Docker Pipeline Architecture with CloudBees Jenkins Enterprise
PDF
Atlanta Jenkins Area Meetup October 22nd 2015
PDF
Docker + jenkins in the enterprise (3)
PDF
Pimp your jenkins platform with docker - Devops.com 2015/11
PDF
Continuous Delivery with Jenkins Workflow
PPTX
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
PDF
Automate App Container Delivery with CI/CD and DevOps
PPTX
7 Habits of Highly Effective Jenkins Users
Distributed Docker Pipeline Architecture with CloudBees Jenkins Enterprise
Atlanta Jenkins Area Meetup October 22nd 2015
Docker + jenkins in the enterprise (3)
Pimp your jenkins platform with docker - Devops.com 2015/11
Continuous Delivery with Jenkins Workflow
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Automate App Container Delivery with CI/CD and DevOps
7 Habits of Highly Effective Jenkins Users

What's hot (20)

PPTX
Next-gen DevOps engineering with Docker and Kubernetes by Antons Kranga
PDF
Continuous Delivery Pipeline with Docker and Jenkins
PPTX
Jenkins, pipeline and docker
PDF
Peering Inside the Black Box: A Case for Observability
PDF
Pimp your Continuous Delivery Pipeline with Jenkins workflow (W-JAX 14)
PPTX
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
PDF
Jenkins Workflow Webinar - Dec 10, 2014
PDF
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
PDF
Deployment Automation with Docker
PPTX
SD DevOps Meet-up - Jenkins 2.0 and Pipeline-as-Code
PDF
Introduction to Docker - Vellore Institute of Technology
PDF
Mihai Criveti - PyCon Ireland - Automate Everything
PDF
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
PDF
Demystifying Docker
PDF
JavaCro'14 - Continuous delivery of Java EE applications with Jenkins and Doc...
PDF
Analyze This! CloudBees Jenkins Cluster Operations and Analytics
PPTX
Micronaut: A new way to build microservices
PDF
DCEU 18: Use Cases and Practical Solutions for Docker Container Storage on Sw...
PDF
DCSF 19 Building Your Development Pipeline
PDF
Dockerfile Tutorial with Example | Creating your First Dockerfile | Docker Tr...
Next-gen DevOps engineering with Docker and Kubernetes by Antons Kranga
Continuous Delivery Pipeline with Docker and Jenkins
Jenkins, pipeline and docker
Peering Inside the Black Box: A Case for Observability
Pimp your Continuous Delivery Pipeline with Jenkins workflow (W-JAX 14)
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Jenkins Workflow Webinar - Dec 10, 2014
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
Deployment Automation with Docker
SD DevOps Meet-up - Jenkins 2.0 and Pipeline-as-Code
Introduction to Docker - Vellore Institute of Technology
Mihai Criveti - PyCon Ireland - Automate Everything
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
Demystifying Docker
JavaCro'14 - Continuous delivery of Java EE applications with Jenkins and Doc...
Analyze This! CloudBees Jenkins Cluster Operations and Analytics
Micronaut: A new way to build microservices
DCEU 18: Use Cases and Practical Solutions for Docker Container Storage on Sw...
DCSF 19 Building Your Development Pipeline
Dockerfile Tutorial with Example | Creating your First Dockerfile | Docker Tr...
Ad

Similar to 7 Habits of Highly Effective Jenkins Users (20)

PPTX
CI/CD Development in Kubernetes - Skaffold
PDF
How to Dockerize Web Application using Docker Compose
PDF
Code Factory avec GitLab CI et Rancher
PDF
Cicd.pdf
PPTX
Docker In Brief
PPTX
Continous delivery at docker age
PPTX
Demystifying Docker101
PPTX
Cloud native buildpacks-cncf
PDF
Code Factory avec GitLab CI et Rancher
PPTX
[Devopsdays2021] Roll Your Product with Kaizen Culture
PDF
Locally it worked! virtualizing docker
PPTX
Azure DevOps in Action
PDF
A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024
PDF
Serverless Container with Source2Image
PDF
Serverless containers … with source-to-image
PDF
Tanzu Developer Connect Workshop - English
PDF
Virtual Developer Connect Workshop - English
PPTX
Development workflow guide for building docker apps
PPTX
Development workflow guide for building docker apps
PPTX
Docker and Jenkins [as code]
CI/CD Development in Kubernetes - Skaffold
How to Dockerize Web Application using Docker Compose
Code Factory avec GitLab CI et Rancher
Cicd.pdf
Docker In Brief
Continous delivery at docker age
Demystifying Docker101
Cloud native buildpacks-cncf
Code Factory avec GitLab CI et Rancher
[Devopsdays2021] Roll Your Product with Kaizen Culture
Locally it worked! virtualizing docker
Azure DevOps in Action
A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024
Serverless Container with Source2Image
Serverless containers … with source-to-image
Tanzu Developer Connect Workshop - English
Virtual Developer Connect Workshop - English
Development workflow guide for building docker apps
Development workflow guide for building docker apps
Docker and Jenkins [as code]
Ad

More from Jules Pierre-Louis (18)

PPTX
The Coming Earthquake in IIS and SQL Configuration Management
PDF
Diving Deeper into DevOps Deployments
PPTX
Microservice Monitoring and Quality Management for Modern Apps and Infrastruc...
PPTX
The Human Side of DevSecOps
PPTX
Sandstorm or Significant: The evolving role of context in Incident Management
PPTX
Cloud bees and forester open source is not enough
PPTX
From Monolith to Microservices – and Beyond!
PPTX
Efficient Performance Test Automation - Opitmizing the Jenkins Pipeline
PPTX
How to Build the Right Automation
PPTX
Starting and Scaling Devops
PPTX
Starting and Scaling DevOps
PPTX
Containers: DevOp Enablers of Technical Solutions
PPTX
Adopting DevOps @ Scale: Lessons learned at Hertz, Kaiser Permanente and lBM
PDF
Managing Quality of Service for Containerized Microservice Applications
PPTX
The Evolution of Application Release Automation
PDF
DevOPs Transformation Workshop
PDF
Pipeline: Continuous Delivery as Code in Jenkins 2.0
PPTX
Webinar: A Roadmap for DevOps Success
The Coming Earthquake in IIS and SQL Configuration Management
Diving Deeper into DevOps Deployments
Microservice Monitoring and Quality Management for Modern Apps and Infrastruc...
The Human Side of DevSecOps
Sandstorm or Significant: The evolving role of context in Incident Management
Cloud bees and forester open source is not enough
From Monolith to Microservices – and Beyond!
Efficient Performance Test Automation - Opitmizing the Jenkins Pipeline
How to Build the Right Automation
Starting and Scaling Devops
Starting and Scaling DevOps
Containers: DevOp Enablers of Technical Solutions
Adopting DevOps @ Scale: Lessons learned at Hertz, Kaiser Permanente and lBM
Managing Quality of Service for Containerized Microservice Applications
The Evolution of Application Release Automation
DevOPs Transformation Workshop
Pipeline: Continuous Delivery as Code in Jenkins 2.0
Webinar: A Roadmap for DevOps Success

Recently uploaded (20)

PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Nekopoi APK 2025 free lastest update
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Autodesk AutoCAD Crack Free Download 2025
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
medical staffing services at VALiNTRY
PDF
17 Powerful Integrations Your Next-Gen MLM Software Needs
PDF
Salesforce Agentforce AI Implementation.pdf
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
assetexplorer- product-overview - presentation
PDF
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
history of c programming in notes for students .pptx
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Nekopoi APK 2025 free lastest update
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
Computer Software and OS of computer science of grade 11.pptx
CHAPTER 2 - PM Management and IT Context
Designing Intelligence for the Shop Floor.pdf
wealthsignaloriginal-com-DS-text-... (1).pdf
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Autodesk AutoCAD Crack Free Download 2025
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
medical staffing services at VALiNTRY
17 Powerful Integrations Your Next-Gen MLM Software Needs
Salesforce Agentforce AI Implementation.pdf
Advanced SystemCare Ultimate Crack + Portable (2025)
Adobe Illustrator 28.6 Crack My Vision of Vector Design
assetexplorer- product-overview - presentation
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
How to Choose the Right IT Partner for Your Business in Malaysia
history of c programming in notes for students .pptx

7 Habits of Highly Effective Jenkins Users