Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
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
2
870
JCConf2016 Jenkins Pipeline
JCConf 2016 For Jenkins Pipeline, see:
https://github.com/qrtt1/JCConf2016_JenkinsPipeline
Ching Yi Chan
October 11, 2016
Tweet
Share
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
170
twjug-lite-17 結束了幾個月的 Java Web 培訓 站在人蔘迷途的我
qrtt1
0
110
[twjug-lite] 迷你研發部 [1]
qrtt1
0
1.2k
寫個好懂的程式
qrtt1
1
650
OAuth 2.0 Authorization Code Flow
qrtt1
0
320
types of knowledge
qrtt1
1
1.4k
twjug 小活動
qrtt1
0
500
TWJUG 2019
qrtt1
0
230
Learning Concepts
qrtt1
0
260
Other Decks in How-to & DIY
See All in How-to & DIY
JAWS-UG 山梨 第10回 勉強会 Community Update
awsjcpm
0
920
Trying "Vibe No-code/Low-code" with MCP #noderedjp
n0bisuke2
0
130
「変えること」「変わること」を楽しむ力で"敵わない存在"と向き合う
subroh0508
2
1.5k
Node-REDでセンサーなどから起動させるカメラノードを作ったよ IoTLT vol123 #iotlt
n0bisuke2
0
130
2025版 鯖落ちパーツで安価に機械学習用マシンを作ってみる
bobfromjapan
0
630
[電子工作]クリップモーターをつくろう
oriontakemura
1
650
JAWS-UG/AWSコミュニティ -JAWS-UGくまもと#16
awsjcpm
1
200
多摩ニュータウンを、 味わう
aokiplayer
PRO
0
360
SoracomUG-Ishikawa-1.pdf
yukima77
0
160
Burnoutとの「対話」 〜 アジャイルコーチングを活用した、燃え尽き症候群を克服するスキル 〜 / Dialogue with Burnout by Using Agile Coaching Skills
hageyahhoo
0
740
JAWS-UGのご紹介 JAWS-UGとは?
awsjcpm
0
5.6k
JAWS-UG/AWSコミュニティプログラムのご紹介 - JAWS-UG 佐賀
awsjcpm
2
220
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
72
12k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
590
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
330
A better future with KSS
kneath
240
18k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
200
The Invisible Side of Design
smashingmag
302
51k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
370
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
190
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