Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
JCConf2016 Jenkins Pipeline
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Ching Yi Chan
October 11, 2016
How-to & DIY
950
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
JCConf2016 Jenkins Pipeline
JCConf 2016 For Jenkins Pipeline, see:
https://github.com/qrtt1/JCConf2016_JenkinsPipeline
Ching Yi Chan
October 11, 2016
More Decks by Ching Yi Chan
See All by Ching Yi Chan
[coscup] Reading and modifying the source code of the dbt adapter
qrtt1
0
220
twjug-lite-17 結束了幾個月的 Java Web 培訓 站在人蔘迷途的我
qrtt1
0
200
[twjug-lite] 迷你研發部 [1]
qrtt1
0
1.3k
寫個好懂的程式
qrtt1
1
730
OAuth 2.0 Authorization Code Flow
qrtt1
0
360
types of knowledge
qrtt1
1
1.5k
twjug 小活動
qrtt1
0
560
TWJUG 2019
qrtt1
0
270
Learning Concepts
qrtt1
0
310
Other Decks in How-to & DIY
See All in How-to & DIY
JAWS/AWS Community Updates in JAWS-UG富山 at 富山高専
awsjcpm
0
130
移動は善 / 20260124-NGK2026S
girigiribauer
1
230
地域コミュニティって いいよね/Local Communities Are Pretty Great
aokiplayer
1
160
決まらない会議を卒業しよう 意思決定を進化させるワークショップ
andrearc
0
240
ミニ四駆でト技会ミニカーバトルに参戦?
covao
0
120
2026.6.27 お誕生日会で配布された透明シェルを交換する際の注意点について
mongonta0716
0
260
OpenClawハンズオンでのトラブルとデバイス向けなんちゃらクロー #IoTLT vol133
n0bisuke2
1
320
Optional<Bar>うらばなし
ryomm
2
380
進捗報告 + 開発の連鎖
tanakamasayuki
1
520
LT#9 非線形な物理現象に基づく真性乱数生成器の構築と、暗号学的エントロピー密度の定量的評価について
sakopon
0
150
社会人9年目の僕が贈る処世術
coco_se
1
390
私がカンファレンスのプロポーザルを書くときに考えていること
kotomin_m
1
830
Featured
See All Featured
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
67k
Unsuck your backbone
ammeep
672
58k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
290
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
710
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
280
GraphQLとの向き合い方2022年版
quramy
50
15k
Six Lessons from altMBA
skipperchong
29
4.5k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
Ethics towards AI in product and experience design
skipperchong
2
440
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
410
Transcript
Jenkins Pipeline 簡介 qrtt1 Ҟᑺ
什麼是 Pipeline • Delivery Pipeline (from Continuous Delivery) • Jenkins
Workflow Plugins • Job Workflow Pipeline • Pipeline 由多個 Step 組成,並且⽀支援 Pause/Resume • Pipeline 內的狀態必需可序列化 (Serializable) • 或宣告為不必列⼊入狀態 @NonCPS 的 function
為什麼是 Pipeline • 依然是 Jenkins Job 的⼀一種,依然很 FreeStyle。 • 為的是
Pipeline as Code • 它是 groovy DSL (domain specific language) و͉છՓ ˢ FreeStyle һ FreeStyle
Pipeline DSL • Jenkins 的 Pipeline 介紹 https://jenkins.io/solutions/pipeline/ • Pipeline
寫作教學 https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md • Pipeline 設計說明 https://github.com/jenkinsci/workflow-cps-plugin/blob/master/README.md • Pipeline Steps Reference https://jenkins.io/doc/pipeline/steps/ • Pipeline 最佳實踐 https://www.cloudbees.com/blog/top-10-best-practices-jenkins-pipeline-plugin ˴ࠅவࡈ ༾Ցਪᕚݟவࡈ
建⽴立 Pipeline Job • Pipeline Script from in-place editor •
Pipeline Script from SCM • Multi-branch Pipeline (from SCM) પᑥԴ͜4$.ٙ˙ό ቇΥఊਖ਼ࣩdʔΝචݬٙ1JQFMJOFІਗܔͭ සપᑥᏐ͜ᗇ᜕4DSJQUႧج
建⽴立 Pipeline 的⽅方式 • Pipeline Script Editor
建⽴立 Pipeline 的⽅方式 • Pipeline Script from SCM
Pipeline 規劃 SCM Checkout War Build Test SCM Commit Deploy
Release
Pipeline Script DEMO/Overview
Steps: node, stage, echo node { stage ('checkout') { echo
'checkout from git' } stage ('build') { echo 'build' } // … skip … } ίࡳɓ̨ዚኜൺ ࡳɓࡈචݬ ਂԬʡჿ
Steps: git stage ('checkout') { echo 'checkout from git' git
url: 'https://my-scm/path/my-project.git' branch: 'master' } optional
Steps: dir, pwd, sh (bat) dir ('project') { pwd() stage
('build') { sh """gradle clean build""" } stage ('test') { sh """gradle check""" } // … skip … }
Steps: step, archiveArtifacts stage ('archive') { step([$class: 'ArtifactArchiver', artifacts:
"build/**/*.war", fingerprint: true]) } stage ('archive') { archiveArtifacts artifacts: "build/**/*.war", fingerprint: true } ᔚٙᄳج อٙᄳج requires Jenkins 2.2+ with newer plugins
Refactoring Pipeline • 使⽤用 Function 合併多個 steps 為⼀一個有意義的動作 • 實作新的
Pipeline Step • 使⽤用 Pipeline Shared Libraries Ыဵək ೌج༨1JQFMJOF4DSJQUԴ͜ ̥ঐપญl https://github.com/jenkinsci/workflow-cps-global-lib-plugin https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Shared+Groovy+Libraries+Plugin
Pipeline Shared Library • 使⽤用⽅方法 • 啟⽤用 Jenkins ssh (因為
Jenkins 內建的 git repo ⺫⽬目前僅能 ssh auth) • 安裝 Plugin (id: workflow-cps-global-lib) • 使⽤用 git 指令 commit & push 提交 Shared Library 並在 Pipeline Script 開始使⽤用 https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+SSH XFCDPOTPMFฤరQMVHJOҬʔՑd͜DMJٜટܲༀыl
Pipeline 使⽤用⼼心得 • Pipeline as Code 可以⽅方便版本管理 • 內建的 Pipeline
Step 不夠多,得常得依賴 sh 或 bat 呼叫外部指令。 • 間接使⽤用 DevOps Tool 處理 • Ansible, Chef, Puppet • Ant, Maven, Gradle
Q & A