SlideShare a Scribd company logo
1 of 67
Download to read offline
©2016 CloudBees, Inc. All Rights Reserved 1©2016 CloudBees, Inc. All Rights Reserved
Jenkins 2.0
川口耕介 / CTO / CloudBees, Inc.
kk@kohsuke.org / @kohsukekawa
©2016 CloudBees, Inc. All Rights Reserved 2
自己紹介
• 川口耕介
• Jenkinsを作った人
• CloudBeesの最高技術責任者
©2016 CloudBees, Inc. All Rights Reserved 3
©2016 CloudBees, Inc. All Rights Reserved 4
©2016 CloudBees, Inc. All Rights Reserved 5
©2016 CloudBees, Inc. All Rights Reserved 6
ビルド・エージェント総数 (2016年4月時点)
©2016 CloudBees, Inc. All Rights Reserved 7Copyright HBO
©2016 CloudBees, Inc. All Rights Reserved 8Copyright HBO
©2016 CloudBees, Inc. All Rights Reserved 9http://en.wikipedia.org/wiki/File:Grand-Bazaar_Shop.jpg
©2016 CloudBees, Inc. All Rights Reserved 10
©2016 CloudBees, Inc. All Rights Reserved 11
©2016 CloudBees, Inc. All Rights Reserved 12
次の10年
©2016 CloudBees, Inc. All Rights Reserved 13
©2016 CloudBees, Inc. All Rights Reserved 14
©2016 CloudBees, Inc. All Rights Reserved 15
©2016 CloudBees, Inc. All Rights Reserved 16
#1: 広がりつづける自動化の波
©2016 CloudBees, Inc. All Rights Reserved 17
©2016 CloudBees, Inc. All Rights Reserved 18
©2016 CloudBees, Inc. All Rights Reserved 19
©2016 CloudBees, Inc. All Rights Reserved 20
©2016 CloudBees, Inc. All Rights Reserved 21
Source: State of Jenkins Survey Sept. 2015
Jenkinsの利用の拡大
©2016 CloudBees, Inc. All Rights Reserved 22
2013 調査 2015 調査
Jenkinsはミッションクリティカルな存在ですか?
©2016 CloudBees, Inc. All Rights Reserved 23
2013 2015
ビルド 95% 97%
テスト 86% 90%
デプロイ 48% 58%
運用 15% 24%
Jenkinsの用途は?
©2016 CloudBees, Inc. All Rights Reserved 24
どのレベルの自動化を達成しましたか?
59%
30%
11%
CI
CD+手動デプロイ
CD+自動デプロイ
©2016 CloudBees, Inc. All Rights Reserved 25
©2016 CloudBees, Inc. All Rights Reserved 26
#2: コード→○ GUI→× ステート→×
©2016 CloudBees, Inc. All Rights Reserved 27
コード→○ GUI→× ステート→×
• 変更を見える化
• 結果でなく意図を記録する
• 冗長さを避ける
• 大規模になっても大丈夫
©2016 CloudBees, Inc. All Rights Reserved 28
Credit: https://flic.kr/p/nrFHFz
©2016 CloudBees, Inc. All Rights Reserved 29©2016 CloudBees, Inc. All Rights Reserved
パイプラインを作ってみよう
©2016 CloudBees, Inc. All Rights Reserved 30
パイプラインを作ってみよう
©2016 CloudBees, Inc. All Rights Reserved 31
パイプラインを作ってみよう
©2016 CloudBees, Inc. All Rights Reserved 32
パイプラインを作ってみよう
©2016 CloudBees, Inc. All Rights Reserved 33
Jenkinsfile
node('java8') {
// Checkout our source code
stage 'Checkout'
checkout scm
// Build our project
stage 'Build'
sh 'mvn clean install'
// Run our test target
stage 'Test'
sh './test.sh'
// Archive our artifacts
archive 'target/**/*.jar'
}
©2016 CloudBees, Inc. All Rights Reserved 34
並列処理
parallel(
windows: {
// run test on windows
node('windows') {
checkout scm
sh './test.bat'
}
},
linux: {
// run test on linux
node('linux') {
checkout scm
sh './test.sh'
}
}
)
©2016 CloudBees, Inc. All Rights Reserved 35
クリーンアップ処理
try {
sh './test.sh'
} finally {
sh './clean.sh'
}
©2016 CloudBees, Inc. All Rights Reserved 36
人間の作業を含める
def releaseId = input(
message:'リリースノートを更新してリリースIDを入力してください',
parameters: [
[$class: 'TextParameterDefinition', name: 'id']
])
sh "./upload.sh ${releaseId}"
©2016 CloudBees, Inc. All Rights Reserved 37
実行結果の表示
©2016 CloudBees, Inc. All Rights Reserved 38
GitHub Organization Folder
©2016 CloudBees, Inc. All Rights Reserved 39
Organization Folderの利点
• Jenkinsの設定は一度だけ
• Jenkinsfileをコミットするだけ
• ブランチ別のビルド履歴
• プルリクエストの自動ビルドと結果の通知
©2016 CloudBees, Inc. All Rights Reserved 40©2016 CloudBees, Inc. All Rights Reserved
パイプラインのドキュメント
jenkins.io/doc
©2016 CloudBees, Inc. All Rights Reserved 41
ドキュメント
©2016 CloudBees, Inc. All Rights Reserved 42
ドキュメント localhost:8080/workflow-cps-snippetizer/dslReference
©2016 CloudBees, Inc. All Rights Reserved 43©2016 CloudBees, Inc. All Rights Reserved
パイプラインでこんなことも
©2016 CloudBees, Inc. All Rights Reserved 44
Dockerイメージのビルド
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 45
ツールコンテナの活用
node('docker') {
// The `docker` variable introduced by the plugin.
//
// Invoking our Gradle build inside a freshly spun up
// Docker container with JDK8
docker.image('java:8-jdk').inside {
checkout scm
sh './gradlew --info'
archive 'build/libs/**/*.jar'
}
}
©2016 CloudBees, Inc. All Rights Reserved 46
プラグインが豊かにするパイプライン
node {
...
if (env.BRANCH_NAME == 'master') {
sshagent(credentials: ['my-credential-uuid']) {
sh './run-ssh-deploy-script'
}
}
}
©2016 CloudBees, Inc. All Rights Reserved 47
プラグインが豊かにするパイプライン
node {
// Print timestamps for all the wrapped steps
wrap([$class: 'TimestamperBuildWrapper']) {
checkout scm
sh 'mvn clean install'
}
// Archive our artifacts
archive 'target/**/*.jar'
}
github.com/jenkinsci/pipeline-examples
©2016 CloudBees, Inc. All Rights Reserved 48
プラグインが豊かにするパイプライン
node {
stage "Build and test"
timeout(time: 180, unit: 'MINUTES') {
sh "mvn clean install -Dmaven.repo.local=${pwd()}/.repository"
}
stage "Archive test results"
step([$class: 'JUnitResultArchiver',
healthScaleFactor: 20.0,
testResults: '**/target/surefire-reports/*.xml'])
}
©2016 CloudBees, Inc. All Rights Reserved 49©2016 CloudBees, Inc. All Rights Reserved
パイプラインの抽象化と再利用
©2016 CloudBees, Inc. All Rights Reserved 50
Dockerイメージのビルド x100 ?
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 51
container_build 'jenkinsciinfra/bind'
©2016 CloudBees, Inc. All Rights Reserved 52
vars/container_build.groovy
def call(imageName) {
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 53
まとめ: パイプライン
• 複雑な処理が必要な時にうってつけ
• テキストで記述してバージョン管理
• ジョブが多くてもテンプレート化
• Jenkinsを再起動しても続く
©2016 CloudBees, Inc. All Rights Reserved 54
©2016 CloudBees, Inc. All Rights Reserved 55
#3: UIの改善
©2016 CloudBees, Inc. All Rights Reserved 56
#4: 「要組み立て」からの脱却
©2016 CloudBees, Inc. All Rights Reserved 57
©2016 CloudBees, Inc. All Rights Reserved 58
©2016 CloudBees, Inc. All Rights Reserved 59
• お勧めプラグインが最初からついてくる
– 8割の機能を最初から搭載
– ベスト・プラクティスにユーザーを誘導する
Jenkins 2.0 では…
©2016 CloudBees, Inc. All Rights Reserved 60
• プラグイン同士がオー
バーラップする部分の
面倒を見られる
• 開発とQA資源の集中
標準の機能を豊かにするメリット
©2016 CloudBees, Inc. All Rights Reserved 61
ドキュメンテーション
©2016 CloudBees, Inc. All Rights Reserved 62
#5: ユーザーを守る
©2016 CloudBees, Inc. All Rights Reserved 63https://flic.kr/p/otBTLe
©2016 CloudBees, Inc. All Rights Reserved 64
• セキュリティ・チームの発足
• セキュリティ・チームとリリース・チームの連携
• セキュリティ勧告と事前アナウンスメント
• アプリ内でのユーザーの誘導
今までも一歩一歩改善してきた
©2016 CloudBees, Inc. All Rights Reserved 65
• 最初からより安全なディフォルト
2.0ではまた一歩先へ
©2016 CloudBees, Inc. All Rights Reserved 66
• 一からやり直したわけではなく、コアは1.xと同じ
系列
• 今までと同じアップデートの仕方で!
後方互換性もバッチリ
©2016 CloudBees, Inc. All Rights Reserved 67
まとめ: Jenkins 2.0
• Pipeline as Code
• UIの改善
• 「要組み立て」からの脱却
• セキュリティ
• CI → CDへ

More Related Content

What's hot

OWIN って何?
OWIN って何?OWIN って何?
OWIN って何?miso- soup3
 
AKS (k8s) Hands on Lab Contents
AKS (k8s) Hands on Lab ContentsAKS (k8s) Hands on Lab Contents
AKS (k8s) Hands on Lab ContentsYoshio Terada
 
REST with Spring Boot #jqfk
REST with Spring Boot #jqfkREST with Spring Boot #jqfk
REST with Spring Boot #jqfkToshiaki Maki
 
ASP.NETの進化とASP.NET Core Blazorの凄さ
ASP.NETの進化とASP.NET Core Blazorの凄さASP.NETの進化とASP.NET Core Blazorの凄さ
ASP.NETの進化とASP.NET Core Blazorの凄さSho Okada
 
Quarkus による超音速な Spring アプリケーション開発
Quarkus による超音速な Spring アプリケーション開発Quarkus による超音速な Spring アプリケーション開発
Quarkus による超音速な Spring アプリケーション開発Chihiro Ito
 
巨大不明ビルドの継続的統合を目的とするビルドパイプラインを主軸とした作戦要綱
巨大不明ビルドの継続的統合を目的とするビルドパイプラインを主軸とした作戦要綱巨大不明ビルドの継続的統合を目的とするビルドパイプラインを主軸とした作戦要綱
巨大不明ビルドの継続的統合を目的とするビルドパイプラインを主軸とした作戦要綱Kiyotaka Oku
 
Consumer Driven Contractsで REST API/マイクロサービスをテスト #m3tech
Consumer Driven Contractsで REST API/マイクロサービスをテスト #m3techConsumer Driven Contractsで REST API/マイクロサービスをテスト #m3tech
Consumer Driven Contractsで REST API/マイクロサービスをテスト #m3techToshiaki Maki
 
Multibranch Pipeline with Docker 入門編
Multibranch Pipeline with Docker 入門編Multibranch Pipeline with Docker 入門編
Multibranch Pipeline with Docker 入門編kimulla
 
どこよりも早い Spring Boot 1.2 解説 #渋谷Java
どこよりも早い Spring Boot 1.2 解説 #渋谷Javaどこよりも早い Spring Boot 1.2 解説 #渋谷Java
どこよりも早い Spring Boot 1.2 解説 #渋谷JavaToshiaki Maki
 
NginxとLuaを用いた動的なリバースプロキシでデプロイを 100 倍速くした
NginxとLuaを用いた動的なリバースプロキシでデプロイを 100 倍速くしたNginxとLuaを用いた動的なリバースプロキシでデプロイを 100 倍速くした
NginxとLuaを用いた動的なリバースプロキシでデプロイを 100 倍速くしたtoshi_pp
 

What's hot (20)

Amazon ECSとDevOps
Amazon ECSとDevOpsAmazon ECSとDevOps
Amazon ECSとDevOps
 
OWIN って何?
OWIN って何?OWIN って何?
OWIN って何?
 
Jenkins 再入門
Jenkins 再入門Jenkins 再入門
Jenkins 再入門
 
AKS (k8s) Hands on Lab Contents
AKS (k8s) Hands on Lab ContentsAKS (k8s) Hands on Lab Contents
AKS (k8s) Hands on Lab Contents
 
Openshift 20191121
Openshift 20191121Openshift 20191121
Openshift 20191121
 
REST with Spring Boot #jqfk
REST with Spring Boot #jqfkREST with Spring Boot #jqfk
REST with Spring Boot #jqfk
 
ASP.NETの進化とASP.NET Core Blazorの凄さ
ASP.NETの進化とASP.NET Core Blazorの凄さASP.NETの進化とASP.NET Core Blazorの凄さ
ASP.NETの進化とASP.NET Core Blazorの凄さ
 
Quarkus による超音速な Spring アプリケーション開発
Quarkus による超音速な Spring アプリケーション開発Quarkus による超音速な Spring アプリケーション開発
Quarkus による超音速な Spring アプリケーション開発
 
Quarkus入門
Quarkus入門Quarkus入門
Quarkus入門
 
Wagby on Cloud Foundry
Wagby on Cloud FoundryWagby on Cloud Foundry
Wagby on Cloud Foundry
 
第六回Jenkins勉強会
第六回Jenkins勉強会第六回Jenkins勉強会
第六回Jenkins勉強会
 
Fcp
FcpFcp
Fcp
 
巨大不明ビルドの継続的統合を目的とするビルドパイプラインを主軸とした作戦要綱
巨大不明ビルドの継続的統合を目的とするビルドパイプラインを主軸とした作戦要綱巨大不明ビルドの継続的統合を目的とするビルドパイプラインを主軸とした作戦要綱
巨大不明ビルドの継続的統合を目的とするビルドパイプラインを主軸とした作戦要綱
 
Jenkinsstudy#4kokawa
Jenkinsstudy#4kokawaJenkinsstudy#4kokawa
Jenkinsstudy#4kokawa
 
Consumer Driven Contractsで REST API/マイクロサービスをテスト #m3tech
Consumer Driven Contractsで REST API/マイクロサービスをテスト #m3techConsumer Driven Contractsで REST API/マイクロサービスをテスト #m3tech
Consumer Driven Contractsで REST API/マイクロサービスをテスト #m3tech
 
Multibranch Pipeline with Docker 入門編
Multibranch Pipeline with Docker 入門編Multibranch Pipeline with Docker 入門編
Multibranch Pipeline with Docker 入門編
 
ProjectAtomic-and-geard
ProjectAtomic-and-geardProjectAtomic-and-geard
ProjectAtomic-and-geard
 
どこよりも早い Spring Boot 1.2 解説 #渋谷Java
どこよりも早い Spring Boot 1.2 解説 #渋谷Javaどこよりも早い Spring Boot 1.2 解説 #渋谷Java
どこよりも早い Spring Boot 1.2 解説 #渋谷Java
 
NginxとLuaを用いた動的なリバースプロキシでデプロイを 100 倍速くした
NginxとLuaを用いた動的なリバースプロキシでデプロイを 100 倍速くしたNginxとLuaを用いた動的なリバースプロキシでデプロイを 100 倍速くした
NginxとLuaを用いた動的なリバースプロキシでデプロイを 100 倍速くした
 
Java on Azure 2019
Java on Azure 2019Java on Azure 2019
Java on Azure 2019
 

Similar to Jenkins 2.0 (日本語)

Rancher2.3とwindows Containerで作るkubernetesクラスタ
Rancher2.3とwindows Containerで作るkubernetesクラスタRancher2.3とwindows Containerで作るkubernetesクラスタ
Rancher2.3とwindows Containerで作るkubernetesクラスタTakashi Kanai
 
Contrail deploy by Juju/MAAS
Contrail deploy by Juju/MAASContrail deploy by Juju/MAAS
Contrail deploy by Juju/MAASIkuo Kumagai
 
今だからこそ知りたい Docker Compose/Swarm 入門
今だからこそ知りたい Docker Compose/Swarm 入門今だからこそ知りたい Docker Compose/Swarm 入門
今だからこそ知りたい Docker Compose/Swarm 入門Masahito Zembutsu
 
使ってわかる 今どきのdocker超入門
使ってわかる 今どきのdocker超入門使ってわかる 今どきのdocker超入門
使ってわかる 今どきのdocker超入門Kazuhide Okamura
 
AWSのインフラはプログラミングコードで構築!AWS Cloud Development Kit 入門
AWSのインフラはプログラミングコードで構築!AWS Cloud Development Kit 入門AWSのインフラはプログラミングコードで構築!AWS Cloud Development Kit 入門
AWSのインフラはプログラミングコードで構築!AWS Cloud Development Kit 入門Amazon Web Services Japan
 
成長を加速する minne の技術基盤戦略
成長を加速する minne の技術基盤戦略成長を加速する minne の技術基盤戦略
成長を加速する minne の技術基盤戦略Hiroshi SHIBATA
 
Chefで始めるWindows Server構築
Chefで始めるWindows Server構築Chefで始めるWindows Server構築
Chefで始めるWindows Server構築Takashi Kanai
 
Docker ComposeでMastodonが必要なものを梱包する話
Docker ComposeでMastodonが必要なものを梱包する話Docker ComposeでMastodonが必要なものを梱包する話
Docker ComposeでMastodonが必要なものを梱包する話Masahito Zembutsu
 
Klocwork C/C++解析チューニング 概要
Klocwork C/C++解析チューニング 概要Klocwork C/C++解析チューニング 概要
Klocwork C/C++解析チューニング 概要Masaru Horioka
 
ビルドサーバで使うDocker
ビルドサーバで使うDockerビルドサーバで使うDocker
ビルドサーバで使うDockerMasashi Shinbara
 
microPCFを使ってみよう
microPCFを使ってみようmicroPCFを使ってみよう
microPCFを使ってみようHiroaki_UKAJI
 
Windows Server 2016でコンテナを動かしてみた
Windows Server 2016でコンテナを動かしてみたWindows Server 2016でコンテナを動かしてみた
Windows Server 2016でコンテナを動かしてみたTakashi Kanai
 
シラサギハンズオン 1015 1016
シラサギハンズオン 1015 1016シラサギハンズオン 1015 1016
シラサギハンズオン 1015 1016Yu Ito
 
AITCシニア技術者勉強会 「今さら聞けないWebサイト開発」 vol2
AITCシニア技術者勉強会 「今さら聞けないWebサイト開発」 vol2AITCシニア技術者勉強会 「今さら聞けないWebサイト開発」 vol2
AITCシニア技術者勉強会 「今さら聞けないWebサイト開発」 vol2近藤 繁延
 
はじめてのコンテナーDocker & Windows & Linux
はじめてのコンテナーDocker & Windows & LinuxはじめてのコンテナーDocker & Windows & Linux
はじめてのコンテナーDocker & Windows & LinuxKazushi Kamegawa
 
Docker入門-基礎編 いまから始めるDocker管理【2nd Edition】
Docker入門-基礎編 いまから始めるDocker管理【2nd Edition】Docker入門-基礎編 いまから始めるDocker管理【2nd Edition】
Docker入門-基礎編 いまから始めるDocker管理【2nd Edition】Masahito Zembutsu
 
Osc spring cloud_stack20130223
Osc spring cloud_stack20130223Osc spring cloud_stack20130223
Osc spring cloud_stack20130223Noriko Suto
 
Server side Swift & Photo Booth
Server side Swift & Photo Booth Server side Swift & Photo Booth
Server side Swift & Photo Booth LINE Corporation
 

Similar to Jenkins 2.0 (日本語) (20)

Rancher2.3とwindows Containerで作るkubernetesクラスタ
Rancher2.3とwindows Containerで作るkubernetesクラスタRancher2.3とwindows Containerで作るkubernetesクラスタ
Rancher2.3とwindows Containerで作るkubernetesクラスタ
 
Contrail deploy by Juju/MAAS
Contrail deploy by Juju/MAASContrail deploy by Juju/MAAS
Contrail deploy by Juju/MAAS
 
今だからこそ知りたい Docker Compose/Swarm 入門
今だからこそ知りたい Docker Compose/Swarm 入門今だからこそ知りたい Docker Compose/Swarm 入門
今だからこそ知りたい Docker Compose/Swarm 入門
 
使ってわかる 今どきのdocker超入門
使ってわかる 今どきのdocker超入門使ってわかる 今どきのdocker超入門
使ってわかる 今どきのdocker超入門
 
AWSのインフラはプログラミングコードで構築!AWS Cloud Development Kit 入門
AWSのインフラはプログラミングコードで構築!AWS Cloud Development Kit 入門AWSのインフラはプログラミングコードで構築!AWS Cloud Development Kit 入門
AWSのインフラはプログラミングコードで構築!AWS Cloud Development Kit 入門
 
成長を加速する minne の技術基盤戦略
成長を加速する minne の技術基盤戦略成長を加速する minne の技術基盤戦略
成長を加速する minne の技術基盤戦略
 
Chefで始めるWindows Server構築
Chefで始めるWindows Server構築Chefで始めるWindows Server構築
Chefで始めるWindows Server構築
 
Docker ComposeでMastodonが必要なものを梱包する話
Docker ComposeでMastodonが必要なものを梱包する話Docker ComposeでMastodonが必要なものを梱包する話
Docker ComposeでMastodonが必要なものを梱包する話
 
ACI Kubernetes Integration
ACI Kubernetes IntegrationACI Kubernetes Integration
ACI Kubernetes Integration
 
Klocwork C/C++解析チューニング 概要
Klocwork C/C++解析チューニング 概要Klocwork C/C++解析チューニング 概要
Klocwork C/C++解析チューニング 概要
 
ビルドサーバで使うDocker
ビルドサーバで使うDockerビルドサーバで使うDocker
ビルドサーバで使うDocker
 
Bambooによる継続的デリバリー
Bambooによる継続的デリバリーBambooによる継続的デリバリー
Bambooによる継続的デリバリー
 
microPCFを使ってみよう
microPCFを使ってみようmicroPCFを使ってみよう
microPCFを使ってみよう
 
Windows Server 2016でコンテナを動かしてみた
Windows Server 2016でコンテナを動かしてみたWindows Server 2016でコンテナを動かしてみた
Windows Server 2016でコンテナを動かしてみた
 
シラサギハンズオン 1015 1016
シラサギハンズオン 1015 1016シラサギハンズオン 1015 1016
シラサギハンズオン 1015 1016
 
AITCシニア技術者勉強会 「今さら聞けないWebサイト開発」 vol2
AITCシニア技術者勉強会 「今さら聞けないWebサイト開発」 vol2AITCシニア技術者勉強会 「今さら聞けないWebサイト開発」 vol2
AITCシニア技術者勉強会 「今さら聞けないWebサイト開発」 vol2
 
はじめてのコンテナーDocker & Windows & Linux
はじめてのコンテナーDocker & Windows & LinuxはじめてのコンテナーDocker & Windows & Linux
はじめてのコンテナーDocker & Windows & Linux
 
Docker入門-基礎編 いまから始めるDocker管理【2nd Edition】
Docker入門-基礎編 いまから始めるDocker管理【2nd Edition】Docker入門-基礎編 いまから始めるDocker管理【2nd Edition】
Docker入門-基礎編 いまから始めるDocker管理【2nd Edition】
 
Osc spring cloud_stack20130223
Osc spring cloud_stack20130223Osc spring cloud_stack20130223
Osc spring cloud_stack20130223
 
Server side Swift & Photo Booth
Server side Swift & Photo Booth Server side Swift & Photo Booth
Server side Swift & Photo Booth
 

More from Kohsuke Kawaguchi

Workflow, container, and beyond
Workflow, container, and beyondWorkflow, container, and beyond
Workflow, container, and beyondKohsuke Kawaguchi
 
JavaOne 2014: Next Step in Automation: Elastic Build Environment
JavaOne 2014: Next Step in Automation: Elastic Build EnvironmentJavaOne 2014: Next Step in Automation: Elastic Build Environment
JavaOne 2014: Next Step in Automation: Elastic Build EnvironmentKohsuke Kawaguchi
 
On sharing ideas & sharing code
On sharing ideas & sharing codeOn sharing ideas & sharing code
On sharing ideas & sharing codeKohsuke Kawaguchi
 
コードの互換性と進化の両立
コードの互換性と進化の両立コードの互換性と進化の両立
コードの互換性と進化の両立Kohsuke Kawaguchi
 
Jenkins User Conference 2013: Literate, multi-branch, mobile and more
Jenkins User Conference 2013: Literate, multi-branch, mobile and moreJenkins User Conference 2013: Literate, multi-branch, mobile and more
Jenkins User Conference 2013: Literate, multi-branch, mobile and moreKohsuke Kawaguchi
 
Jenkins User Conference 2013 Palo Alto: Keynote
Jenkins User Conference 2013 Palo Alto: KeynoteJenkins User Conference 2013 Palo Alto: Keynote
Jenkins User Conference 2013 Palo Alto: KeynoteKohsuke Kawaguchi
 
How we made jenkins community
How we made jenkins communityHow we made jenkins community
How we made jenkins communityKohsuke Kawaguchi
 
Large scale automation with jenkins
Large scale automation with jenkinsLarge scale automation with jenkins
Large scale automation with jenkinsKohsuke Kawaguchi
 
Jenkins User Conference 2012 San Francisco
Jenkins User Conference 2012 San FranciscoJenkins User Conference 2012 San Francisco
Jenkins User Conference 2012 San FranciscoKohsuke Kawaguchi
 
Jenkins+Gitによる検証済みマージ(30分版)
Jenkins+Gitによる検証済みマージ(30分版)Jenkins+Gitによる検証済みマージ(30分版)
Jenkins+Gitによる検証済みマージ(30分版)Kohsuke Kawaguchi
 
ここ最近のJenkins新機能
ここ最近のJenkins新機能ここ最近のJenkins新機能
ここ最近のJenkins新機能Kohsuke Kawaguchi
 
Jenkins user conference 東京
Jenkins user conference 東京Jenkins user conference 東京
Jenkins user conference 東京Kohsuke Kawaguchi
 
Developer summit continuous deliveryとjenkins
Developer summit   continuous deliveryとjenkinsDeveloper summit   continuous deliveryとjenkins
Developer summit continuous deliveryとjenkinsKohsuke Kawaguchi
 
Creating a Developer Community
Creating a Developer CommunityCreating a Developer Community
Creating a Developer CommunityKohsuke Kawaguchi
 
Jenkins user conference 2011
Jenkins user conference 2011Jenkins user conference 2011
Jenkins user conference 2011Kohsuke Kawaguchi
 
プロジェクト現状報告・Rubyによるjenkinsプラグイン開発
プロジェクト現状報告・Rubyによるjenkinsプラグイン開発プロジェクト現状報告・Rubyによるjenkinsプラグイン開発
プロジェクト現状報告・Rubyによるjenkinsプラグイン開発Kohsuke Kawaguchi
 

More from Kohsuke Kawaguchi (20)

Workflow, container, and beyond
Workflow, container, and beyondWorkflow, container, and beyond
Workflow, container, and beyond
 
JavaOne 2014: Next Step in Automation: Elastic Build Environment
JavaOne 2014: Next Step in Automation: Elastic Build EnvironmentJavaOne 2014: Next Step in Automation: Elastic Build Environment
JavaOne 2014: Next Step in Automation: Elastic Build Environment
 
On sharing ideas & sharing code
On sharing ideas & sharing codeOn sharing ideas & sharing code
On sharing ideas & sharing code
 
コードの互換性と進化の両立
コードの互換性と進化の両立コードの互換性と進化の両立
コードの互換性と進化の両立
 
Jenkins User Conference 2013: Literate, multi-branch, mobile and more
Jenkins User Conference 2013: Literate, multi-branch, mobile and moreJenkins User Conference 2013: Literate, multi-branch, mobile and more
Jenkins User Conference 2013: Literate, multi-branch, mobile and more
 
Jenkins User Conference 2013 Palo Alto: Keynote
Jenkins User Conference 2013 Palo Alto: KeynoteJenkins User Conference 2013 Palo Alto: Keynote
Jenkins User Conference 2013 Palo Alto: Keynote
 
Jenkins State of union 2013
Jenkins State of union 2013Jenkins State of union 2013
Jenkins State of union 2013
 
How we made jenkins community
How we made jenkins communityHow we made jenkins community
How we made jenkins community
 
Large scale automation with jenkins
Large scale automation with jenkinsLarge scale automation with jenkins
Large scale automation with jenkins
 
Jenkins User Conference 2012 San Francisco
Jenkins User Conference 2012 San FranciscoJenkins User Conference 2012 San Francisco
Jenkins User Conference 2012 San Francisco
 
Jenkins+Gitによる検証済みマージ(30分版)
Jenkins+Gitによる検証済みマージ(30分版)Jenkins+Gitによる検証済みマージ(30分版)
Jenkins+Gitによる検証済みマージ(30分版)
 
ここ最近のJenkins新機能
ここ最近のJenkins新機能ここ最近のJenkins新機能
ここ最近のJenkins新機能
 
Jenkins user conference 東京
Jenkins user conference 東京Jenkins user conference 東京
Jenkins user conference 東京
 
Dev@cloudの実装
Dev@cloudの実装Dev@cloudの実装
Dev@cloudの実装
 
Developer summit continuous deliveryとjenkins
Developer summit   continuous deliveryとjenkinsDeveloper summit   continuous deliveryとjenkins
Developer summit continuous deliveryとjenkins
 
Creating a Developer Community
Creating a Developer CommunityCreating a Developer Community
Creating a Developer Community
 
Jenkins user conference 2011
Jenkins user conference 2011Jenkins user conference 2011
Jenkins user conference 2011
 
プロジェクト現状報告・Rubyによるjenkinsプラグイン開発
プロジェクト現状報告・Rubyによるjenkinsプラグイン開発プロジェクト現状報告・Rubyによるjenkinsプラグイン開発
プロジェクト現状報告・Rubyによるjenkinsプラグイン開発
 
Current state of Jenkins
Current state of JenkinsCurrent state of Jenkins
Current state of Jenkins
 
Jenkins勉強会第二回
Jenkins勉強会第二回Jenkins勉強会第二回
Jenkins勉強会第二回
 

Jenkins 2.0 (日本語)

  • 1. ©2016 CloudBees, Inc. All Rights Reserved 1©2016 CloudBees, Inc. All Rights Reserved Jenkins 2.0 川口耕介 / CTO / CloudBees, Inc. kk@kohsuke.org / @kohsukekawa
  • 2. ©2016 CloudBees, Inc. All Rights Reserved 2 自己紹介 • 川口耕介 • Jenkinsを作った人 • CloudBeesの最高技術責任者
  • 3. ©2016 CloudBees, Inc. All Rights Reserved 3
  • 4. ©2016 CloudBees, Inc. All Rights Reserved 4
  • 5. ©2016 CloudBees, Inc. All Rights Reserved 5
  • 6. ©2016 CloudBees, Inc. All Rights Reserved 6 ビルド・エージェント総数 (2016年4月時点)
  • 7. ©2016 CloudBees, Inc. All Rights Reserved 7Copyright HBO
  • 8. ©2016 CloudBees, Inc. All Rights Reserved 8Copyright HBO
  • 9. ©2016 CloudBees, Inc. All Rights Reserved 9http://en.wikipedia.org/wiki/File:Grand-Bazaar_Shop.jpg
  • 10. ©2016 CloudBees, Inc. All Rights Reserved 10
  • 11. ©2016 CloudBees, Inc. All Rights Reserved 11
  • 12. ©2016 CloudBees, Inc. All Rights Reserved 12 次の10年
  • 13. ©2016 CloudBees, Inc. All Rights Reserved 13
  • 14. ©2016 CloudBees, Inc. All Rights Reserved 14
  • 15. ©2016 CloudBees, Inc. All Rights Reserved 15
  • 16. ©2016 CloudBees, Inc. All Rights Reserved 16 #1: 広がりつづける自動化の波
  • 17. ©2016 CloudBees, Inc. All Rights Reserved 17
  • 18. ©2016 CloudBees, Inc. All Rights Reserved 18
  • 19. ©2016 CloudBees, Inc. All Rights Reserved 19
  • 20. ©2016 CloudBees, Inc. All Rights Reserved 20
  • 21. ©2016 CloudBees, Inc. All Rights Reserved 21 Source: State of Jenkins Survey Sept. 2015 Jenkinsの利用の拡大
  • 22. ©2016 CloudBees, Inc. All Rights Reserved 22 2013 調査 2015 調査 Jenkinsはミッションクリティカルな存在ですか?
  • 23. ©2016 CloudBees, Inc. All Rights Reserved 23 2013 2015 ビルド 95% 97% テスト 86% 90% デプロイ 48% 58% 運用 15% 24% Jenkinsの用途は?
  • 24. ©2016 CloudBees, Inc. All Rights Reserved 24 どのレベルの自動化を達成しましたか? 59% 30% 11% CI CD+手動デプロイ CD+自動デプロイ
  • 25. ©2016 CloudBees, Inc. All Rights Reserved 25
  • 26. ©2016 CloudBees, Inc. All Rights Reserved 26 #2: コード→○ GUI→× ステート→×
  • 27. ©2016 CloudBees, Inc. All Rights Reserved 27 コード→○ GUI→× ステート→× • 変更を見える化 • 結果でなく意図を記録する • 冗長さを避ける • 大規模になっても大丈夫
  • 28. ©2016 CloudBees, Inc. All Rights Reserved 28 Credit: https://flic.kr/p/nrFHFz
  • 29. ©2016 CloudBees, Inc. All Rights Reserved 29©2016 CloudBees, Inc. All Rights Reserved パイプラインを作ってみよう
  • 30. ©2016 CloudBees, Inc. All Rights Reserved 30 パイプラインを作ってみよう
  • 31. ©2016 CloudBees, Inc. All Rights Reserved 31 パイプラインを作ってみよう
  • 32. ©2016 CloudBees, Inc. All Rights Reserved 32 パイプラインを作ってみよう
  • 33. ©2016 CloudBees, Inc. All Rights Reserved 33 Jenkinsfile node('java8') { // Checkout our source code stage 'Checkout' checkout scm // Build our project stage 'Build' sh 'mvn clean install' // Run our test target stage 'Test' sh './test.sh' // Archive our artifacts archive 'target/**/*.jar' }
  • 34. ©2016 CloudBees, Inc. All Rights Reserved 34 並列処理 parallel( windows: { // run test on windows node('windows') { checkout scm sh './test.bat' } }, linux: { // run test on linux node('linux') { checkout scm sh './test.sh' } } )
  • 35. ©2016 CloudBees, Inc. All Rights Reserved 35 クリーンアップ処理 try { sh './test.sh' } finally { sh './clean.sh' }
  • 36. ©2016 CloudBees, Inc. All Rights Reserved 36 人間の作業を含める def releaseId = input( message:'リリースノートを更新してリリースIDを入力してください', parameters: [ [$class: 'TextParameterDefinition', name: 'id'] ]) sh "./upload.sh ${releaseId}"
  • 37. ©2016 CloudBees, Inc. All Rights Reserved 37 実行結果の表示
  • 38. ©2016 CloudBees, Inc. All Rights Reserved 38 GitHub Organization Folder
  • 39. ©2016 CloudBees, Inc. All Rights Reserved 39 Organization Folderの利点 • Jenkinsの設定は一度だけ • Jenkinsfileをコミットするだけ • ブランチ別のビルド履歴 • プルリクエストの自動ビルドと結果の通知
  • 40. ©2016 CloudBees, Inc. All Rights Reserved 40©2016 CloudBees, Inc. All Rights Reserved パイプラインのドキュメント jenkins.io/doc
  • 41. ©2016 CloudBees, Inc. All Rights Reserved 41 ドキュメント
  • 42. ©2016 CloudBees, Inc. All Rights Reserved 42 ドキュメント localhost:8080/workflow-cps-snippetizer/dslReference
  • 43. ©2016 CloudBees, Inc. All Rights Reserved 43©2016 CloudBees, Inc. All Rights Reserved パイプラインでこんなことも
  • 44. ©2016 CloudBees, Inc. All Rights Reserved 44 Dockerイメージのビルド 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() }
  • 45. ©2016 CloudBees, Inc. All Rights Reserved 45 ツールコンテナの活用 node('docker') { // The `docker` variable introduced by the plugin. // // Invoking our Gradle build inside a freshly spun up // Docker container with JDK8 docker.image('java:8-jdk').inside { checkout scm sh './gradlew --info' archive 'build/libs/**/*.jar' } }
  • 46. ©2016 CloudBees, Inc. All Rights Reserved 46 プラグインが豊かにするパイプライン node { ... if (env.BRANCH_NAME == 'master') { sshagent(credentials: ['my-credential-uuid']) { sh './run-ssh-deploy-script' } } }
  • 47. ©2016 CloudBees, Inc. All Rights Reserved 47 プラグインが豊かにするパイプライン node { // Print timestamps for all the wrapped steps wrap([$class: 'TimestamperBuildWrapper']) { checkout scm sh 'mvn clean install' } // Archive our artifacts archive 'target/**/*.jar' } github.com/jenkinsci/pipeline-examples
  • 48. ©2016 CloudBees, Inc. All Rights Reserved 48 プラグインが豊かにするパイプライン node { stage "Build and test" timeout(time: 180, unit: 'MINUTES') { sh "mvn clean install -Dmaven.repo.local=${pwd()}/.repository" } stage "Archive test results" step([$class: 'JUnitResultArchiver', healthScaleFactor: 20.0, testResults: '**/target/surefire-reports/*.xml']) }
  • 49. ©2016 CloudBees, Inc. All Rights Reserved 49©2016 CloudBees, Inc. All Rights Reserved パイプラインの抽象化と再利用
  • 50. ©2016 CloudBees, Inc. All Rights Reserved 50 Dockerイメージのビルド x100 ? 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() }
  • 51. ©2016 CloudBees, Inc. All Rights Reserved 51 container_build 'jenkinsciinfra/bind'
  • 52. ©2016 CloudBees, Inc. All Rights Reserved 52 vars/container_build.groovy def call(imageName) { 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() } }
  • 53. ©2016 CloudBees, Inc. All Rights Reserved 53 まとめ: パイプライン • 複雑な処理が必要な時にうってつけ • テキストで記述してバージョン管理 • ジョブが多くてもテンプレート化 • Jenkinsを再起動しても続く
  • 54. ©2016 CloudBees, Inc. All Rights Reserved 54
  • 55. ©2016 CloudBees, Inc. All Rights Reserved 55 #3: UIの改善
  • 56. ©2016 CloudBees, Inc. All Rights Reserved 56 #4: 「要組み立て」からの脱却
  • 57. ©2016 CloudBees, Inc. All Rights Reserved 57
  • 58. ©2016 CloudBees, Inc. All Rights Reserved 58
  • 59. ©2016 CloudBees, Inc. All Rights Reserved 59 • お勧めプラグインが最初からついてくる – 8割の機能を最初から搭載 – ベスト・プラクティスにユーザーを誘導する Jenkins 2.0 では…
  • 60. ©2016 CloudBees, Inc. All Rights Reserved 60 • プラグイン同士がオー バーラップする部分の 面倒を見られる • 開発とQA資源の集中 標準の機能を豊かにするメリット
  • 61. ©2016 CloudBees, Inc. All Rights Reserved 61 ドキュメンテーション
  • 62. ©2016 CloudBees, Inc. All Rights Reserved 62 #5: ユーザーを守る
  • 63. ©2016 CloudBees, Inc. All Rights Reserved 63https://flic.kr/p/otBTLe
  • 64. ©2016 CloudBees, Inc. All Rights Reserved 64 • セキュリティ・チームの発足 • セキュリティ・チームとリリース・チームの連携 • セキュリティ勧告と事前アナウンスメント • アプリ内でのユーザーの誘導 今までも一歩一歩改善してきた
  • 65. ©2016 CloudBees, Inc. All Rights Reserved 65 • 最初からより安全なディフォルト 2.0ではまた一歩先へ
  • 66. ©2016 CloudBees, Inc. All Rights Reserved 66 • 一からやり直したわけではなく、コアは1.xと同じ 系列 • 今までと同じアップデートの仕方で! 後方互換性もバッチリ
  • 67. ©2016 CloudBees, Inc. All Rights Reserved 67 まとめ: Jenkins 2.0 • Pipeline as Code • UIの改善 • 「要組み立て」からの脱却 • セキュリティ • CI → CDへ

Editor's Notes

  1. And no one is slowing down! With CloudBees unique perspective of Jenkins usage, the growth is driving our business as well. Expansion in Jenkins adoption is why we’re seeing over 150% growth in our business, which focuses on just a fraction of the global users.
  2. Let’s assume you have Jenkins 2.0 running, using the suggested plugins -> When you click on “New Item”, in addition to the new look, you’ll see “Pipeline” ->
  3. -> For this demo we’ll just create a simple Pipeline called “Niagara” ->
  4. Inside the usual job configuration you’ll find a PIpeline script text area In this example, we’ve inserted the Hello World example -> There’s a lot going on in this screenshot
  5. Inside the usual job configuration you’ll find a PIpeline script text area In this example, we’ve inserted the Hello World example -> There’s a lot going on in this screenshot
  6. This is a very simple Jenkinsfile, just like one you might check into a repository It defines three stages: Checkout Build Test This just a basic example, but if you can imagine how this was once configured in the Jenkins Web UI. Now this can be checked in, with an audit trail and easily evolve alongside the project -> This is basic, just using built-in steps ->
  7. This is a very simple Jenkinsfile, just like one you might check into a repository It defines three stages: Checkout Build Test This just a basic example, but if you can imagine how this was once configured in the Jenkins Web UI. Now this can be checked in, with an audit trail and easily evolve alongside the project -> This is basic, just using built-in steps ->
  8. This is a very simple Jenkinsfile, just like one you might check into a repository It defines three stages: Checkout Build Test This just a basic example, but if you can imagine how this was once configured in the Jenkins Web UI. Now this can be checked in, with an audit trail and easily evolve alongside the project -> This is basic, just using built-in steps ->
  9. This is a very simple Jenkinsfile, just like one you might check into a repository It defines three stages: Checkout Build Test This just a basic example, but if you can imagine how this was once configured in the Jenkins Web UI. Now this can be checked in, with an audit trail and easily evolve alongside the project -> This is basic, just using built-in steps ->
  10. The snippet generator can be used to prorotype snippets of Pipeline
  11. and in text / not just calling other jobs, but do stuff within itself