SlideShare a Scribd company logo
Jenkins 2.0
Make Jenkins Great Again!
Miyata Jumpei (@miyajan)
Mar 18, 2017
Productivity Engineering - Forkwell Meetup #4
⾃⼰紹介
• 宮⽥ 淳平 (@miyajan)
• Cybozu
• ⽣産性向上チーム
• Jenkinsおじさん
Jenkins 2.0!
Background
History
• 2005 Hudson 1.0
• 2011 Forked to Jenkins
• 2016/04 Jenkins 2.0
Jenkins 1.0
• 10 years
• 100K active users
• 1000 plugins
• CI
•
• /UI
• Jenkins
• CI/CD
• UX
https://jenkins.io/blog/2016/04/26/jenkins-20-is-here/
Jenkins 2.0
• 10
•
• 1.0
• Deprecated: Jenkins
$ docker run -p 8080:8080 jenkins:2.32.3
# http://localhost:8080
Try Jenkins 2.0
Jenkins 2.0 Features
Suggested Plugins
•
•
• …
Jenkins 1.0
Suggested Plugins
•
•
• Pipeline, Git, Mail, Credential Binding, etc.
Jenkins 2.0
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Pipeline
•
• Build Pipeline Plugin
• Delivery Pipeline Plugin
•
•
•
Jenkins 1.0
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Pipeline Plugin
• DSL( )
• 1
•
• master
Jenkins 2.0
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Pipeline DSL
GUI
•
•
• JobConfigHistory Plugin …
Jenkins 1.0
300 input
Pipeline as Code
• DSL(Groovy)
•
•
•
Jenkins 2.0
•
•
• https://github.com/jenkinsci/pipeline-
plugin/blob/master/COMPATIBILITY.md
•
• https://github.com/jenkinsci/pipeline-
plugin/blob/master/DEVGUIDE.md
Jenkins 2.0
Scripted Pipeline &
Declarative Pipeline
Scripted Pipeline
• Pipeline
•
•
• try/catch…
Jenkins 2.0
node(‘has-docker’) {
try {
checkout scm
stage(‘Build’) {
sh ‘mvn clean install’
}
stage(‘Archive’) {
( )
}
if (currentBuild.result == 'SUCCESS') {
mail to:"me@example.com", subject:"SUCCESS", body: "passed."
}
}
catch (exc) {
mail to:"me@example.com", subject:"FAILURE", body: "failed."
}
finally {
deleteDir()
}
}
Declarative Pipeline
•
•
• Lint
Jenkins 2.0
pipeline {
agent label:’has-docker’, dockerfile: true
stages {
stage("Build") {
steps {
sh 'mvn clean install'
}
}
stage("Archive"){
( )
}
}
post {
always {
deleteDir()
}
success {
mail to:"me@example.com", subject:"SUCCESS", body: "passed."
}
failure {
mail to:"me@example.com", subject:"FAILURE", body: "failed."
}
}
}
Lint
•
• curl ssh lint
• https://github.com/jenkinsci/pipeline-model-
definition-plugin/wiki/Validating-(or-linting)-a-
Declarative-Jenkinsfile-from-the-command-line
• npm
• https://www.npmjs.com/package/jflint
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Lint from CLI
• curl ssh lint
• https://github.com/jenkinsci/pipeline-model-
definition-plugin/wiki/Validating-(or-linting)-a-
Declarative-Jenkinsfile-from-the-command-line
• npm
• https://www.npmjs.com/package/jflint
• Declarative Pipeline
• “script” Scripted
Pipeline
Declarative Pipeline
Examples
Build in Container
// simple
agent {
docker “ubuntu:16.04”
}
// specify label & args
agent {
docker {
image “ubuntu:16.04”
label “docker-nodes”
args “-v /tmp:/tmp -p 8000:8000”
}
}
Credentials
Credentials
environment {
// type: secret text
// SECRET_TEXT is defined
SECRET_TEXT = credentials(‘SECRET_TEXT')
// type: username and password
// SECRET_AUTH_USR and SECRET_AUTH_PSW are defined
SECRET_AUTH = credentials('SECRET_AUTH')
}
Options
pipeline {
options {
// 7
buildDiscarder(logRotator(daysToKeepStr: '7'))
}
}
Triggers
pipeline {
triggers {
cron('* * * * *')
}
}
Parallel
stage("Commit") {
steps {
parallel(
unitTest: {
…
},
staticAnalysis: {
…
},
package: {
…
}
)
}
}
Conditions
stage("Production") {
when {
branch "master"
}
steps {
// deploy to production
}
}
Stash
stage("Archive") {
agent {
docker “java:8”
}
steps {
sh “gradle jar”
stash name: “jar”, includes: “build/libs/*.jar”
}
}
stage(“Deployment”) {
agent {
docker …
}
steps {
unstash “jar”
// jar
}
}
User Input
stage("Production") {
steps {
input “Ready to deploy?”
}
}
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Syntax
• https://github.com/jenkinsci/pipeline-model-
definition-plugin/wiki/Syntax-Reference
• https://jenkins.io/doc/book/pipeline/syntax/
Shared Libraries
•
• …
• subtree or submodule…?
Jenkins 1.0
Shared Libraries
• GitHub
• Groovy
• https://jenkins.io/doc/book/pipeline/shared-
libraries/
Jenkins 2.0
Example: without Library
pipeline {
…
post {
failure {
// echo ‘failure!’ with red color
ansiColor('xterm') {
echo '033[0;31mFailure!033[0m'
}
}
}
…
}
vars/echoErr.groovy
#!/usr/bin/env groovy
def call(String text) {
ansiColor('xterm') {
echo “033[0;31m${text}033[0m"
}
}
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
(repository root)
+- vars
- +- echoErr.groovy
Example: with Library
@Library('miyata-shared-libraries') _
pipeline {
…
post {
failure {
echoErr ‘Failure!’
}
}
…
}
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
• DRY
•
• @Library('my-shared-library@1.0') _
•
GitHub
• push
• commit status
GitHub Plugin
•
•
commit status pending 

commit status …
•
Jenkins 1.0
GitHub Organization Folder
• Organization
• Jenkinsfile Multibranch
Pipeline GitHub
Jenkins 2.0
Multibranch Pipeline
•
• Jenkinsfile
•
Jenkins 2.0
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
• 1
•
• Webhook
• BitBucket
Blue Ocean
Classic Jenkins UI
• UX
Jenkins 1.0
Blue Ocean
• UX
•
• RC
•
• Blue Ocean Plugin
Jenkins 2.0
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Pipeline Editor
Pipeline Editor
• Blue Ocean
• Jenkinsfile GUI
Jenkins 2.0
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
stage
•
• Enterprise
• Groovy …
• JENKINS-33846
• LTS …
• LTS(stable)
•
GUI
•
•
• init.groovy.d ...
•
• https://github.com/jenkinsci/system-config-dsl-
plugin
Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜
Best Practices
• Declarative Pipeline
• GitHub Organization Folder
• Blue Ocean
References
• https://jenkins.io/doc/
• https://jenkins.io/node/
• https://www.cloudbees.com/juc/agenda
Cybozu Meetup
1
2 : https://cybozu.connpass.com/event/52668/

More Related Content

PDF
Jenkins 2.0 Pipeline & Blue Ocean
PDF
Jenkinsfileのlintで救える命がある
PDF
細かすぎて伝わらないかもしれない Azure Container Networking Deep Dive
PPTX
Kubernetes Introduction
PPTX
Infra as Code with Packer, Ansible and Terraform
PDF
쿠버네티스를 이용한 기능 브랜치별 테스트 서버 만들기 (GitOps CI/CD)
PDF
Kubernetes 疲れに Azure Container Apps はいかがでしょうか?(江東区合同ライトニングトーク 発表資料)
PDF
ログ+メトリック+トレースの組み合わせで構築する一元的なオブザーバビリティ
Jenkins 2.0 Pipeline & Blue Ocean
Jenkinsfileのlintで救える命がある
細かすぎて伝わらないかもしれない Azure Container Networking Deep Dive
Kubernetes Introduction
Infra as Code with Packer, Ansible and Terraform
쿠버네티스를 이용한 기능 브랜치별 테스트 서버 만들기 (GitOps CI/CD)
Kubernetes 疲れに Azure Container Apps はいかがでしょうか?(江東区合同ライトニングトーク 発表資料)
ログ+メトリック+トレースの組み合わせで構築する一元的なオブザーバビリティ

What's hot (20)

PPTX
AlloyDBを触ってみた!(第33回PostgreSQLアンカンファレンス@オンライン 発表資料)
PDF
Kubernetesのしくみ やさしく学ぶ 内部構造とアーキテクチャー
PDF
Kubernetes
PDF
Azure ADとIdentity管理
PPTX
SDL2の紹介
PDF
Keycloak拡張入門
PDF
Kubernetes 101
PDF
CI/CD 101
PDF
Kubernetes Secrets Management on Production with Demo
PDF
Tackling Complexity
PPTX
01. Kubernetes-PPT.pptx
PPTX
Jenkins CI presentation
PPTX
Qlik Cloudデータ統合:Data Gateway - Data Movementのセットアップ
PDF
1. Docker Introduction.pdf
PDF
Introduction to Kubernetes Workshop
PPTX
Goss入門
PDF
「DevSecOpsとは?」の一歩先 (CloudNative Days Tokyo 2021)
PDF
Learning postgresql
PDF
Kubernetes - introduction
PPTX
Metaspace
AlloyDBを触ってみた!(第33回PostgreSQLアンカンファレンス@オンライン 発表資料)
Kubernetesのしくみ やさしく学ぶ 内部構造とアーキテクチャー
Kubernetes
Azure ADとIdentity管理
SDL2の紹介
Keycloak拡張入門
Kubernetes 101
CI/CD 101
Kubernetes Secrets Management on Production with Demo
Tackling Complexity
01. Kubernetes-PPT.pptx
Jenkins CI presentation
Qlik Cloudデータ統合:Data Gateway - Data Movementのセットアップ
1. Docker Introduction.pdf
Introduction to Kubernetes Workshop
Goss入門
「DevSecOpsとは?」の一歩先 (CloudNative Days Tokyo 2021)
Learning postgresql
Kubernetes - introduction
Metaspace
Ad

Viewers also liked (20)

PDF
3000社の業務データ絞り込みを支える技術
PPTX
WalB: Real-time and Incremental Backup System for Block Devices
PDF
離れた場所でも最高のチームワークを実現する方法 ーサイボウズ開発チームのリモートワーク事例ー
PDF
あなたの開発チームには、チームワークがあふれていますか?
PPTX
Api Strat Portland 2017 Serverless Extensibility talk
PDF
サイボウズのフロントエンド開発 現在とこれからの挑戦
PPTX
すべての人にチームワークを サイボウズのアクセシビリティ
PDF
サイボウズのサービスを支えるログ基盤
PDF
遅いクエリと向き合う仕組み #CybozuMeetup
PDF
すべてを自動化せよ! 〜生産性向上チームの挑戦〜
PDF
Kubernetes in 30 minutes (2017/03/10)
PDF
Kubernetesにまつわるエトセトラ(主に苦労話)
PDF
形態素解析
PDF
小さく始める大規模スクラム
PPTX
プロジェクト管理でkintone
PDF
缶詰屋さんの課題解決にスクラムを使ってみた
PPTX
導入に困っているあなたに贈る スクラム導入コミュニケーション術
PDF
なんたって”DevQA” アジャイル開発とQAの合体が改善を生む - 永田 敦 氏 #postudy
PDF
[RSGT2017] つらい問題に出会ったら
3000社の業務データ絞り込みを支える技術
WalB: Real-time and Incremental Backup System for Block Devices
離れた場所でも最高のチームワークを実現する方法 ーサイボウズ開発チームのリモートワーク事例ー
あなたの開発チームには、チームワークがあふれていますか?
Api Strat Portland 2017 Serverless Extensibility talk
サイボウズのフロントエンド開発 現在とこれからの挑戦
すべての人にチームワークを サイボウズのアクセシビリティ
サイボウズのサービスを支えるログ基盤
遅いクエリと向き合う仕組み #CybozuMeetup
すべてを自動化せよ! 〜生産性向上チームの挑戦〜
Kubernetes in 30 minutes (2017/03/10)
Kubernetesにまつわるエトセトラ(主に苦労話)
形態素解析
小さく始める大規模スクラム
プロジェクト管理でkintone
缶詰屋さんの課題解決にスクラムを使ってみた
導入に困っているあなたに贈る スクラム導入コミュニケーション術
なんたって”DevQA” アジャイル開発とQAの合体が改善を生む - 永田 敦 氏 #postudy
[RSGT2017] つらい問題に出会ったら
Ad

Similar to Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜 (20)

PDF
(Declarative) Jenkins Pipelines
PDF
Codetainer: a Docker-based browser code 'sandbox'
PDF
Docker and Puppet for Continuous Integration
PDF
Our Puppet Story (GUUG FFG 2015)
PDF
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
PDF
Travis, Circle そして Jenkins 2.0
PDF
Road to Opscon (Pisa '15) - DevOoops
PDF
Un jenkins amélioré avec docker mesos et marathon à Devoxx 2015
PPTX
Docker 1.11 Presentation
PDF
DevOPS training - Day 2/2
PDF
Dockercon 2015 Recap
PDF
Jenkins Pipelines
PPTX
Docker Enterprise Workshop - Technical
PPTX
What's new in Docker - InfraKit - Docker Meetup Berlin 2016
PDF
How to create your own hack environment
KEY
Building Dojo in the Cloud
PPTX
Introduction to InSpec and 1.0 release update
PPSX
Docker Kubernetes Istio
PDF
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
PDF
ITB2017 - Keynote
(Declarative) Jenkins Pipelines
Codetainer: a Docker-based browser code 'sandbox'
Docker and Puppet for Continuous Integration
Our Puppet Story (GUUG FFG 2015)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Travis, Circle そして Jenkins 2.0
Road to Opscon (Pisa '15) - DevOoops
Un jenkins amélioré avec docker mesos et marathon à Devoxx 2015
Docker 1.11 Presentation
DevOPS training - Day 2/2
Dockercon 2015 Recap
Jenkins Pipelines
Docker Enterprise Workshop - Technical
What's new in Docker - InfraKit - Docker Meetup Berlin 2016
How to create your own hack environment
Building Dojo in the Cloud
Introduction to InSpec and 1.0 release update
Docker Kubernetes Istio
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
ITB2017 - Keynote

More from Jumpei Miyata (17)

PDF
開発者の生産性向上を妨げる障壁と サイボウズの生産性向上チームの取り組み
PDF
オートスケールする GitHub Actions セルフホストランナーを構築してる話
PDF
GitHub Actions のはじめかた
PDF
サイボウズの開発を支える GitHub × CircleCI
PDF
サイボウズを支えるCircleCI
PDF
サイボウズの CI/CD 事情 〜Jenkins おじさんは CircleCI おじさんにしんかした!〜
PDF
組織横断でエンジニアを支援する生産性向上チームの役割
PDF
【PR】エンジニアがkintoneを試すべき3つの理由
PDF
受入試験を自動化したらDevとQAのフィードバックループがまわりはじめた話
PDF
Effective Automation 〜変化に強い開発基盤〜
PDF
開発者を支える生産性向上チームの取り組み -CI, Browser Test, Tools and Infrastructure-
PDF
テストエンジニアと組織構造 @Cybozu
PDF
Jenkins 再入門
PDF
Selenium Antipatterns
PPTX
kintoneチームを支えるSeleniumテスト
PPTX
Selenium Conference 2015 参加報告
PDF
ハイパフォーマンスSeleniumテスト@サイボウズ
開発者の生産性向上を妨げる障壁と サイボウズの生産性向上チームの取り組み
オートスケールする GitHub Actions セルフホストランナーを構築してる話
GitHub Actions のはじめかた
サイボウズの開発を支える GitHub × CircleCI
サイボウズを支えるCircleCI
サイボウズの CI/CD 事情 〜Jenkins おじさんは CircleCI おじさんにしんかした!〜
組織横断でエンジニアを支援する生産性向上チームの役割
【PR】エンジニアがkintoneを試すべき3つの理由
受入試験を自動化したらDevとQAのフィードバックループがまわりはじめた話
Effective Automation 〜変化に強い開発基盤〜
開発者を支える生産性向上チームの取り組み -CI, Browser Test, Tools and Infrastructure-
テストエンジニアと組織構造 @Cybozu
Jenkins 再入門
Selenium Antipatterns
kintoneチームを支えるSeleniumテスト
Selenium Conference 2015 参加報告
ハイパフォーマンスSeleniumテスト@サイボウズ

Recently uploaded (20)

PDF
Structs to JSON How Go Powers REST APIs.pdf
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
additive manufacturing of ss316l using mig welding
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Geodesy 1.pptx...............................................
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
web development for engineering and engineering
PDF
composite construction of structures.pdf
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
UNIT 4 Total Quality Management .pptx
Structs to JSON How Go Powers REST APIs.pdf
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
additive manufacturing of ss316l using mig welding
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
CYBER-CRIMES AND SECURITY A guide to understanding
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Embodied AI: Ushering in the Next Era of Intelligent Systems
Geodesy 1.pptx...............................................
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
web development for engineering and engineering
composite construction of structures.pdf
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Foundation to blockchain - A guide to Blockchain Tech
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
UNIT 4 Total Quality Management .pptx

Jenkins 2.0 最新事情 〜Make Jenkins Great Again〜