sd devops meet-up - jenkins 2.0 and pipeline-as-code
TRANSCRIPT
Jenkins 2.0 and Beyond
About JenkinsJenkins 2.0 is an automation engine with an unparalleled plugin ecosystem to support all of your favorite tools in your delivery pipelines, whether your goal is continuous integration, automated testing, or continuous delivery.
Let’s discuss●Why Jenkins 2.0 exists●What is Jenkins 2.0●Pipelines●Other stuff
Meet Jenkins
Jenkins 101
6
• 2005 – Hudson (Sun)• 2008 – It becomes popular, Duke's Choice Award• 2011 – Conflict with Oracle, renaming to Jenkins
• License: MIT (core)• https://github.com/jenkinsci/
Why “automation”?
7
Continuous Integration
Continuous IntegrationContinuous DeliveryDevOps
Accounting automationHome AutomationCRON + WebUI
Jenkins weaknesses. Growth Problems
8Jenkins used to grow faster than its Dev community
Jenkins weaknesses. Compatibility costs
9
• More than 5 years of backward compatibility• Hudson 2 plugins still work on Jenkins!
• BUT:• Architecture design issues, complex APIs• Outdated libs• Outdated UI• Plugin integration issues
...Fixes are on the way
Pipelines in Jenkins 1.x●Create jobs●Trigger “downstream” jobs for next stage●Easy!
Pipelines in Jenkins 1.x
Pipelines in Jenkins 1.x
Pipelines in Jenkins 1.x
Pipelines in Jenkins 1.x
Pipelines in Jenkins 1.x
Pipelines in Jenkins 1.x
Classic Job Configuration UI● All the options you could ever want
○ and more!● Consistent for almost a decade
Low maintenance●Many users install Jenkins once●Usage pattern: “set it, and forget it!”
Meet Jenkins 2.0jenkins-ci.org/2.0
© 2
015
Clou
dBee
s, In
c. A
ll Ri
ghts
Re
serv
ed
20
• CI-to-CD with Pipeline-as-Code• Improved “out of the box” experience• Updated easier to use UI• New Jenkins.xx site
Jenkins 2.0 Themes
Pipeline as Code
© 2
015
Clou
dBee
s, In
c. A
ll Ri
ghts
Re
serv
ed
22
• Entire flow is one concise Groovy script using Workflow DSL– For loops, try-finally, fork-join, etc
• Can restart Jenkins while flow is running• Allocate build nodes and workspaces
– As many as you want, when you want• Stages throttle concurrency of builds• Human input/approval integrated into flow• Standard project concepts: SCM, artifacts, plugins
Key Pipeline Features
© 2
015
Clou
dBee
s, In
c. A
ll Ri
ghts
Re
serv
ed
23
Jenkins Powered CD Pipelines: Jenkins Workflow
Development Production
Commit Build Stage Deploy? ?
Pipelines Need:✓ Branching✓ Looping✓ Restarts✓ Checkpoints✓ Manual Input
Sonar Test
Selenium Test
Perf Test
Jenkins Workflow
© 2
015
Clou
dBee
s, In
c. A
ll Ri
ghts
Re
serv
ed
24
A Real-world CD Pipeline with Jenkins Workflow
Development Production
Jenkins Workflow
Pipeline as Code● Introduce “pipeline” as a new type in Jenkins● Codify an implicit series of stages into an explicit
.Jenkinsfile in your source repository● Resumability/durability of the pipeline state● Extend the DSL with your own steps
github.com/jenkinsci/pipeline-examples
Pipeline DSLnode('docker') { checkout scm
/* Grab the abbreviated SHA1 of our pipeline’s commit. */ sh 'git rev-parse HEAD > GIT_COMMIT' def shortCommit = readFile('GIT_COMMIT').take(6)
stage 'Build' def image = docker.build("jenkinsciinfra/bind:build-${shortCommit}")
stage 'Deploy' image.push()}
© 2
015
Clou
dBee
s, In
c. A
ll Ri
ghts
Re
serv
ed
27
CloudBees Jenkins Pipeline Stage ViewJenkins Pipeline Stage View
SOURCE CODE
CONTROL SYSTEM
Code Commit
</>
Development Production
Jenkins Pipeline
Better Out-of-the-box UX
Better Out-of-the-box UI
User Interface Improvements
User Interface Improvements● Improved “New Item” page● More consistent terminology
2.0 is a drop-in replacement for 1.x● Evolution not revolution● No need to wait
Better Out-of-the-box UX
Better Out-of-the-box UX
Better Out-of-the-box UI
User Interface Improvements
User Interface Improvements
User Interface Improvements●Improved “New Item” page●More consistent terminology
2.0 is a drop-in replacement for 1.x
Get InvolvedJenkins is made of people
Try out Jenkins 2.0●jenkins-ci.org/2.0●[email protected]●#jenkins on Freenode
Get Jenkins 2.0 (alpha) nowjenkins-ci.org/2.0
New Community Site: jenkins.io (Beta) ● Modern platform and UI● Easier to use● 1-2-3-4 Quickstart ● Centralized
Documentation● Solution-oriented Use
Cases● Events listings● Launching March 22nd
Feedback
Q1 – CloudBees Jenkins Platform: Private SaaS Edition
Launched– Jenkins and CJP Certification
Later in 2016– Jenkins 2.0 Release– Jenkins 2.0 LTS Release– Updated User Interface: Blue Ocean– CloudBees Jenkins Platform 16.05 Release– Jenkins World (September)
Recent and Upcoming Activities
Questions and Answers