[ chusiang@coscup-2017 ~ ] $ cat .profile
# Author: 凍仁翔 / chusiang@drx.tw
# Blog: http://note.drx.tw
# Modified: 2017-08-05 13:14
2
#DevOpsTW #COSCUP2017
3
CTS華視
坐穩囉
要開始了了!
4
關於我
• 凍仁翔 (@chusiang_lai)。
• 《凍仁的筆記》站長。
• DevOps Taiwan 志⼯工。
• 1 年年以上的 Ansible 使⽤用經驗。
• 5 年年以上的 IT 維運經驗。
• 第 8 屆 IT 邦幫忙鐵⼈人賽
DevOps 組冠軍。
5
Outline
I. DevOps ⼈人是什什麼?
II. 持續交付是什什麼?
Outline
I. DevOps ⼈人是什什麼?
II. 持續交付是什什麼?
III. Ansible 是什什麼?
IV. 怎麼部署 Ansible 環境?
V. 怎麼操作 Ansible?
Outline
VI. GitLab CI 是什什麼?
VII. Pipeline 是什什麼?
VIII.怎麼操作 GitLab CI?
Outline
VI. GitLab CI 是什什麼?
VII. Pipeline 是什什麼?
VIII.怎麼操作 GitLab CI?
IX. 怎麼⽤用 Ansible 和 GitLab CI 進⾏行行持續交付?
Outline
VI. GitLab CI 是什什麼?
VII. Pipeline 是什什麼?
VIII.怎麼操作 GitLab CI?
IX. 怎麼⽤用 Ansible 和 GitLab CI 進⾏行行持續交付?
X. Q&A
Ⅰ. DevOps ⼈人是什什麼?
11
前⼈人眼中的 DevOps 是什什麼?
https://www.slideshare.net/warfan/devops-agile-tour-taichung-2017
Continuous Delivery with Ansible x GitLab CI
Agile Tour 台中 by 正瑋 x Mina @ 2017.01.14
15
Agile Tour 台中 by 正瑋 x Mina @ 2017.01.14
16
我⼼心中的 DevOps ⼈人是什什麼?
17
開發⼈人 (Dev) 維運⼈人 (Ops) DevOps ⼈人
從裝機到架站 等 Ops 架好? 耗費數⼩小時 (hr) 不⽤用 20 分 (min)
上班 寫 code
敲敲指令裝裝機器

改了了什什麼常常忘記
寫 code 管機器
下班
有事就 On Call

沒事就下班
有事就救火

沒事就 On Call
有事就 On Call

沒事就讓 code

“⾃自⼰己" 管機器
讓我們向被公司 On-call,回不來來的 Sammy Lin

默哀 30 秒。
今天會⽤用到哪些 Tools?
19
Version
Control

(版本控制)
Configuration

Management

(組態設定)
Continuous
Integration

(持續整合)
Measurement

(測量量)
Log
Git

GitLab

GitHub
Ansible

Chef
GitLab CI

Jenkins CI

Travis CI
Zabbix ELK
Provisioning (服務開通)
Vagrant, Docker
今⽇日⽤用到哪些 License?
Apache、LGPL、GPL、MIT。
Ⅱ. 持續交付是什什麼?
21
可以讓我們提早下班的玩意兒!
持續交付是什什麼?
《Continuous Delivery》- https://goo.gl/r9vXFg
持續的、不間斷的、不鬆懈的。
投遞、傳送、交付、交貨。
22
https://www.slideshare.net/MilesChou/continuous-delivery-78368683
《Continuous Delivery 中⽂文版》- https://goo.gl/SK745B
利利⽤用⾃自動化的
建置、測試與部署
,完美創造出可信賴
的軟體發佈
- Jez Humble & David Farley
24
建置
測試
發佈
部署
⾃自動化
建置
測試
發佈
部署
⾃自動化
建置
測試
發佈
部署
⾃自動化
建置
測試
發佈
部署
⾃自動化
建置
測試
發佈
部署
⾃自動化
建置
測試
發佈
部署
⾃自動化
持續交付和持續部署有什什麼不同?
前者需⼿手動發佈 (Release) ⾄至⽣生產環境 (Production),⽽而後者則⾃自動化之。
31
Continuous Delivery
Continuous Deployment
auto auto manual
Build Deploy Test Release
auto auto auto
Build Deploy Test Release
"⼯工⼈人" 交付 持續交付
⼈人為失誤風險 ⾼高 低
交付週期 1 週以上 1 次 提交程式碼即交付
交付時間 > 數⼩小時 < 5 分鐘
可維護性
常常於發佈時救火

(變更更⼯工作 → 例例外⼯工作)
即早發現,即早治療
提早下班 難 易易
導入持續交付的好處是什什麼?
32
Code 還在本機?
推上 Git server?
組態設定對了了?
單元測試過了了?
持續交付過了了?
真 實 案 例例
R&D:我程式寫完了了!
我:(哪裡寫完了了?!)
R&D:我程式寫完了了! 我:等 CD 過了了再說。
Code 還在本機?
推上 Git server?
組態設定對了了?
單元測試過了了?
持續交付過了了?
真 實 案 例例
案例例分析
提前預演變更更⼯工作,以避免
每次變更更都造成例例外⼯工作!
《The Phoenix Project》
Amazon - https://goo.gl/visckK
Ⅲ. Ansible 是什什麼?
36
Ansible 取名⾃自知名⼩小說

《安德的遊戲》,是
虛構的超光速通訊裝置。
有了了它我們就可以像 Ender

指揮戰艦般的操控伺服器。
電影海海報 - https://goo.gl/4xftZT
37
Ansible ⾃自 2013 年年創立,

於 2015 年年被 Red Hat 併購。
iThome - http://goo.gl/yJbWtz
38
Ansible Tower

更更獲選 Linuxpilot 2017

Linux & OSS 最佳解決⽅方案,
擁有最佳系統⾃自動化管理理⽅方案

之名。
Linuxpilot - https://goo.gl/mSxR4E
39
我⼼心中的 Ansible 是什什麼?
1. 與 Puppet, SaltStack, Chef 並列列其四的⾃自動化組態設定
⼯工具 (Infrastructure as Code)。
2. Python 陣營的組態設定⼯工具。
3. 不需幫每台機器 (instance) 安裝 Agent,只要有 Python
和 SSH 就可以闖天下!
4. 容易易上⼿手,是⾺馬上可以⽤用的好物!
5. 社群強⼤大,有商業公司⽀支持的⾃自由軟體。
40
Continuous Delivery with Ansible x GitLab CI
RubyPython
Ansible
SaltStack
Chef
Puppet
我⼼心中的 Ansible 是什什麼?
1. 與 Puppet, SaltStack, Chef 並列列其四的⾃自動化組態設定
⼯工具 (Infrastructure as Code)。
2. Python 陣營的組態設定⼯工具。
3. 不需幫每台機器 (instance) 安裝 Agent,只要有 Python
和 SSH 就可以闖天下!
4. 容易易上⼿手,是⾺馬上可以⽤用的好物!
5. 社群強⼤大,有商業公司⽀支持的⾃自由軟體。
43
導入 Ansible ⾃自動化組態,
我們可以減少服務中斷時間
、測試基礎建設、降低意外
風險,更更可以讓開發、測試
和⽣生產環境無縫接軌。
圖片來來源 - Ansible as Automation Glue
44
真實案例例
每週節省 26 hr 的⼯工時。
(6 x 3) x 2 - (5 x 1) x 2 = 26 hr
1. 減少 (重複) 例例⾏行行性作業的⼈人⼒力力成本,提升團隊⽣生產⼒力力。
2. 節省企業開⽀支。
A. 以年年薪百萬計算,時薪約 $340。(1,000,000 / 365 / 8 = 342)
B. 若若以⼀一個⽉月 4 週,⼀一年年 52 週計算 …
案例例分析
↓ 26 hr / 週 = ↓ $35,360 / ⽉月 = ↓ $459,680 / 年年
有這類困擾?
歡迎上 DevOps Taiwan 找⼯工作。
https://github.com/DevOpsTW/jobs/issues
47
Ⅳ. 怎麼部署 Ansible 環境?
48
觀念念、安裝、設定
Ansible 是怎麼運作的?
透過 inventory 定義 Managed node,並藉由 SSH 與 Python 進⾏行行溝通。
49
怎麼安裝 Ansible?
• 只需在 Control Machine (主控端) 安裝 Ansible;
Managed node 則需 Python 2.5+ 和 SSH。
50
# Debian & Ubuntu (apt).
$ sudo apt-get install ansible
# RHEL & CentOS (yum).
$ sudo yum install ansible
# Mac OS X (homebrew).
$ brew install ansible
# Python (pip).
$ sudo pip install ansible
怎麼設定 Ansible?
• 藉由 ansible.cfg 來來設定 inventory (host file) 檔案路路徑、
Managed node (被控端) 使⽤用者名稱、SSH ⾦金金鑰 … 等。
51
$ vim ansible.cfg
[defaults]
# 指定 inventory 檔案路路徑。
hostfile = hosts
# 遠端使⽤用者名稱
remote_user = docker
#private_key_file = ~/.ssh/id_rsa
# host_key_checking: 不詢問加入 ssh ⾦金金鑰
host_key_checking = False
inventory 是什什麼?
• 定義 Managed node (被控端) 位址與群組的主機清冊,

通常會⽤用來來設定 ssh 或 winrm 的連線資訊。
52
$ vim hosts
# ansible_ssh_host: 遠端 SSH 主機位址。
# ansible_ssh_port: 遠端 SSH 埠⼝口 (Port)。
# ansible_ssh_user: 遠端 SSH 使⽤用者名稱。
# ansible_ssh_private_key_file: 本機 SSH 私鑰檔路路徑。
# ansible_ssh_pass: 遠端 SSH 密碼 (建議改⽤用私鑰)。
[dev]
ansible-demo ansible_ssh_host=127.0.0.1 ansible_ssh_pass=pwd
[test]
ansible-test ansible_ssh_host=172.10.10.1 ansible_ssh_port=2222
[prod]
ansible-prod ansible_ssh_host=10.10.10.1 ansible_ssh_user=deploy
Ⅴ. 怎麼操作 Ansible?
53
Ad-Hoc command, Playbook* (Module)
and
54
Playbooks
Ad-Hoc
commands
簡短的 (臨臨時性) 指令
與⼀一般的 command line 模式雷同,
⼀一次透過⼀一⾏行行指令進⾏行行操作。Ad-Hoc
commands
⼀一般的 command line 是什什麼?
• 這裡的 command line 為 Linux Shell 底下的指令操作,
以下為 ping 和 echo 的操作的結果。
56
$ ping localhost
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.037 ms
--- localhost ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet
loss
round-trip min/avg/max/stddev = 0.037/0.037/0.037/0.000 ms
$ echo Hello World
Hello World
怎麼⽤用 Ad-Hoc commands?
ansible <host-pattern> [-m module_name] [-a args] [options]
• host-pattern: all, server1, server1:server2, server_group.
57
$ ansible all -m ping
localhost | SUCCESS => {
"changed": false,
"ping": "pong"
}
$ ansible all -m command -a "echo Hello World"
localhost | SUCCESS | rc=0 >>
Hello World
# 各個 Module 的詳細說明請參參考官⽅方 All Modules ⽂文件。
劇本
透過事先定義好的動作 (Plays) 與
任務 (Tasks) 來來操控伺服器。
Playbooks
Playbooks 是什什麼?
• 比 Shell Script 更更結構化的腳本
語⾔言,是⼀一鍵部署的好物。
• 使⽤用 YAML 格式,簡單易易讀。
(寫 code 就如同寫⽂文件)
• 通常會有 Play, Task, Module
和 handler 等。
• 藉由 Jinja2 (template 系統)

表達式,使⽤用變數、判斷式

、迴圈等語法。
Baby Playbook Onesie - http://goo.gl/GKJvXn
59
Playbooks 是什什麼?
• ⼀一份 Playbook 可以有多個 Play、多個 Task 和多個 Module。
• 此例例⽤用到了了 Play*1, Task*3 和 Module*3 (command, apt, lineinfile)。

























60
$ vim example.yml
---
- name: This is a Super-basic playbook.
hosts: all
tasks:
- name: Hello World
command: echo "Hello World"
- name: Install Vim & Emacs
become: yes
apt: name={{ item }} state=present
with_items:
- vim
- emacs
# 去去,emacs 走。
- name: use vi-mode in readline
become: yes
lineinfile: path=/etc/inputrc line="set editing-mode vi"
Playbooks 是什什麼?
• 執⾏行行 playbook。
61
$ ansible-playbook example.yml
PLAY [This is a Super-basic playbook.] *****************************************
TASK [setup] *******************************************************************
ok: [ansible-demo.local]
TASK [Hello World] *************************************************************
changed: [ansible-demo.local]
TASK [Install Vim & Emacs] *****************************************************
changed: [ansible-demo.local] => (item=[u'vim', u'emacs'])
TASK [use vi-mode in readline] *************************************************
changed: [ansible-demo.local]
PLAY RECAP *********************************************************************
ansible-demo.local : ok=4 changed=3 unreachable=0 failed=0
Playbooks 是什什麼?
• 執⾏行行 playbook。
62
$ ansible-playbook example.yml
PLAY [This is a Super-basic playbook.] *****************************************
TASK [setup] *******************************************************************
ok: [ansible-demo.local]
TASK [Hello World] *************************************************************
changed: [ansible-demo.local]
TASK [Install Vim & Emacs] *****************************************************
changed: [ansible-demo.local] => (item=[u'vim', u'emacs'])
TASK [use vi-mode in readline] *************************************************
changed: [ansible-demo.local]
PLAY RECAP *********************************************************************
ansible-demo.local : ok=4 changed=3 unreachable=0 failed=0
TASK [setup]:被執⾏行行的 managed node 有哪些
PLAY RECAP:總結 (ok / changed / failed )
Plays 是什什麼?
• 透過動作 (Play) 對特定 Managed node 進⾏行行操控,通常包含 Task 和 Module。
• 此例例⽤用到了了 Play*1, Task*3 和 Module*3 (command, apt, lineinfile)。

























63
$ vim example.yml
---
- name: This is a Super-basic playbook.
hosts: all
tasks:
- name: Hello World
command: echo "Hello World"
- name: Install Vim & Emacs
become: yes
apt: name={{ item }} state=present
with_items:
- vim
- emacs
# 去去,emacs 走。
- name: use vi-mode in readline
become: yes
lineinfile: path=/etc/inputrc line="set editing-mode vi"
Play
Tasks 是什什麼?
• 藉由各種不同的模組 (Module)、迴圈和判斷式等組合來來完成各種任務 (Task)。
• 此例例⽤用到了了 Play*1, Task*3 和 Module*3 (command, apt, lineinfile)。

























64
$ vim example.yml
---
- name: This is a Super-basic playbook.
hosts: all
tasks:
- name: Hello World
command: echo "Hello World"
- name: Install Vim & Emacs
become: yes
apt: name={{ item }} state=present
with_items:
- vim
- emacs
# 去去,emacs 走。
- name: use vi-mode in readline
become: yes
lineinfile: path=/etc/inputrc line="set editing-mode vi"
Task 1
Task 2
Task 3
Modules 是什什麼?
• Ansible 的內建操作⽅方法 (Method),好比 Python 的內建函式。
• 此例例⽤用到了了 Play*1, Task*3 和 Module*3 (command, apt, lineinfile)。

























65
$ vim example.yml
---
- name: This is a Super-basic playbook.
hosts: all
tasks:
- name: Hello World
command: echo "Hello World"
- name: Install Vim & Emacs
become: yes
apt: name={{ item }} state=present
with_items:
- vim
- emacs
# 去去,emacs 走。
- name: use vi-mode in readline
become: yes
lineinfile: path=/etc/inputrc line="set editing-mode vi"
Module
常⽤用的 Ansible Module 有哪些?
apt
• 適⽤用於 Debian、Ubuntu 的 apt 套件模組 (Packaging Modules)。
• 類似的 Linux 指令有 apt, apt-get, aptitude 和 dpkg。























67
# 更更新套件索引 (快取),等同於 apt-get update 指令。
- name: Update repositories cache
become: yes
apt:
update_cache: yes
# 安裝 vim 套件。
- name: Install the package "vim"
become: yes
apt:
name: vim
state: present
lineinfile
• ⽤用正規表⽰示式對檔案進⾏行行插入或取代⽂文字的檔案模組 (Files Modules)。
• 其類似的 Linux 指令為 sed。























68
# Before 2.3, option 'dest', 'destfile' or 'name' was used instead of ‘path'.
# 關閉 SELinux。
- name: disable selinux
lineinfile:
path: /etc/selinux/config
regexp: '^SELINUX='
line: 'SELINUX=enforcing'
# 移除 docker 使⽤用者的 sudo 權限。
- name: remove sudo permission of docker
lineinfile:
path: /etc/sudoers
state: absent
regexp: '^docker'
shell
• 在遠端⽤用 /bin/sh 執⾏行行 shell 指令的指令模組 (Commands Modules),
⽀支援變數 (variables)、< , > , | , ; 和 & 等運算。























69
# 藉由 ls 和 wc 檢查檔案數量量。
- name: check files number
shell: ls /home/docker/ | wc -l
# 列列出所有的 Python ⾏行行程。
- name: show all python process
shell: ps aux | grep python
# 執⾏行行 shell script,並把結果導向 /tmp/result.log。
- name: execute run.sh
shell: ./run.sh > /tmp/result.log
http://s.drx.tw/auto-with-ansible-12
怎麼看 Ansible Modules ⽂文件?
⽬目前⾼高達 1,039 個 Modules,比上次分享時多了了 203 個。
http://docs.ansible.com/ansible/list_of_commands_modules.html
Continuous Delivery with Ansible x GitLab CI
Docs » commands Modules
2
有 yes 就⼀一定要⽤用
1
實 戰 演 練
Practice
75
怎麼⽤用 Jupyter 操控 Ansible?
當 inventory 為 localhost 時,是對 Control Machine 本機進⾏行行操作。
Chu-Siang Lai / chusiang@drx.tw
Play the Ansible on Jupyter notebook !
$ docker run -P -d chusiang/ansible-jupyter:ubuntu-16.04
Ⅵ. GitLab CI 是什什麼?
79
GitLab 是什什麼?
集 Git Repository、Docker Registry、Issue tracking、Code Review、
CI 和 CD 於⼀一⾝身的現代平台。
GitLab CI 可以做什什麼?
Unit Test Integration Test Delivery DeploymeBuildSyntax Check
Ⅶ. Pipeline 是什什麼?
82
管道 (線)?⽣生產線?傻傻分不清楚?!
Ch 5. 部署流⽔水線解析
Ch 6. 建置與部署的腳本化
Ch 7. 提交階段
Ch 8. ⾃自動化驗測試
Ch 9. 非功能性需求測試
Ch 10. 應⽤用程式的部署與發佈
書上寫的 Pipeline 是什什麼?
《Continuous Delivery》- https://goo.gl/r9vXFg
83
84
原始
程式碼
應⽤用程式
設置
提交階段
編譯
單元測試
程式碼分析
組裝 binaries
驗收階段
設置環境
部署 binaries
冒煙測試
驗收測試
UAT 階段
設置環境
部署 binaries
冒煙測試
探索性測試
⽣生產⼒力力測試階段
設置環境
部署 binaries
冒煙測試
執⾏行行⽣生產⼒力力測試
⽣生產環境
設置環境
部署 binaries
冒煙測試
版本控制
⾃自動發佈⾃自動發佈
⼀一鍵發佈
⼀一鍵發佈
Binary 儲存庫
binaries
metadata
程式碼 應⽤用程式設置
binaries metadata binaries
binaries
metadata metadata
Adapted from “Continuous Delivery” © Dave Farley and Jez Humble 2010
Translated by Chu-Siang Lai 2017
我⼼心中的 Pipeline 是什什麼?
導入⾃自動化後,⾃自然顯現出來來的軟體發佈⽣生產線。
GitLab Pipelines ⼜又是什什麼?
圖像化的軟體發佈⽣生產線服務。
Continuous Delivery with Ansible x GitLab CI
Continuous Delivery with Ansible x GitLab CI
Continuous Delivery with Ansible x GitLab CI
Ⅷ. 怎麼操作 GitLab CI?
91
在專案底下建立 .gitlab-ci.yml,當程式碼上傳⾄至 GitLab 即會觸發 GitLab CI。
• 使⽤用 YAML 語法進⾏行行撰寫。此範例例⼤大致可分為 1 個 stage (階段) 和

1 個 job (⼯工作)。























怎麼寫 .gitlab-ci.yml?
$ vim .gitlab-ci.yml
stages:
- build
build_binary:
image: ubuntu:16.04
stage: build
script:
- chmod 755 penguin-htdocs/DEBIAN
- dpkg -b penguin-htdocs
tags:
- docker
怎麼觸發 GitLab CI?
93
Trigger build with git push.
從 Pipelines 看觸發狀狀態。
詳細觸發資訊。
Ⅸ. 怎麼⽤用 Ansible 和 GitLab CI 進⾏行行持續交付?
96
在 GitLab CI 裡,⽤用 Ansible Docker Containers 跑 Playbooks 即可。
Docker
97
AnsibleGitLab CI
https://hub.docker.com/r/chusiang/ansible/
0
$ vim .gitlab-ci.yml
stages:
- build
- deploy
- test
- release
build_binary:
image: ubuntu:16.04
stage: build
script:
# For fix bad permissions of control directory on GitLab CI.
- chmod 755 penguin-htdocs/DEBIAN
# build deb.
- dpkg -b penguin-htdocs
artifacts:
expire_in: 1 week
paths:
- penguin-htdocs.deb
tags:
- docker
...
99
1
...
deploy_to_dev:
image: chusiang/ansible:alpine-3.6
stage: deploy
script:
- ls
- cd ansible-playbooks/
- echo "${VAULT_KEY}" > secret.txt
- ansible-playbook deploy.yml
- rm -f secret.txt
only:
- master@chusiang/coscup2017-cd-demo
- develop@chusiang/coscup2017-cd-demo
- tags@chusiang/coscup2017-cd-demo
tags:
- docker
...
100
22
...
test_dev:
image: chusiang/ansible:alpine-3.6
stage: test
script:
- cd ansible-playbooks/
- echo "${VAULT_KEY}" > secret.txt
- ansible-playbook test.yml
- rm -f secret.txt
only:
- master@chusiang/coscup2017-cd-demo
- develop@chusiang/coscup2017-cd-demo
- tags@chusiang/coscup2017-cd-demo
tags:
- docker
...
101
3
...
release_to_prd:
image: chusiang/ansible:alpine-3.6
stage: release
script:
- cd ansible-playbooks/
- echo "${VAULT_KEY}" > secret.txt
- ansible-playbook -i production deploy.yml
- rm -f secret.txt
only:
- master@chusiang/coscup2017-cd-demo
- tags@chusiang/coscup2017-cd-demo
tags:
- docker
102
4
https://gitlab.com/chusiang/coscup2017-cd-demo
5
README.md (1/2)
Build stage
6
README.md (2/2)
Deploy, Test and
Release stages
7
Pipelines
8
實 戰 演 練 Ⅱ
Practice Ⅱ
107
練習環境為 Control Machine (Alpine 3.6) + Managed node*2 (Ubuntu 16.04)。
透過 GitLab CI 和 Ansible 操控 Managed node
108
Fork me, and send Merge Requests !
請於 fork 後隨意修改,並發送 MR (Pull Requests),因完整的 Pipelines 只會於
chusiang/coscup2017-cd-demo 的特定 Branchs 和打 Tags 才會被觸發。
CD 挑戰賽
A. 開賽後,發送 Merge Requests

⾄至 http://s.drx.tw/cUET 的
develop 和 master branch。
B. 依提交順序收 M.R.。
C. 兩兩條 Pipelines 共 7 個 stages
皆需通過 (success)。
• develop: stage × 3
• master: stage × 4
D. 前 3 名挑戰成功者,將獲得

Ansible 貼紙 1 張!
Code 還在本機?
推上 Git server?
組態設定對了了?
單元測試過了了?
持續交付過了了?
真 實 案 例例
R&D:我程式寫完了了,但還要

等 CD 過了了才⾏行行。
我:讓 Pipelines ⾶飛⼀一下吧!
(好像可以⾶飛的再快⼀一點?!)。
我的 Pipeline 進化史
Unit Test Integration Test Delivery DeploymeBuildSyntax Check
Unit Test Delivery DeploymeBuildSyntax Check
Unit TestDelivery DeploymeBuildSyntax Check
Delivery
Deployme
BuildSyntax Check
BuildSyntax Check
Build
– Chu-Siang Lai
「持續交付是⼀一段⼈人類與企業的進化史。
利利⽤用⼯工具進⾏行行各種加速成長的同時,
也並藉由不斷地練習來來持續進化。」
參參考⽂文獻
1. 提到 DevOps 到底在談些什什麼玩意兒? by Chen Cheng-Wei - https://goo.gl/7YTeKD
2. Continuous Delivery - 敏捷開發的最後⼀一哩路路 by Miles - https://goo.gl/UhpAfG
3. Ansible Documentation - http://docs.ansible.com/ansible/intro_installation.html
4. 《Ansible: Up and Running》- https://www.ansible.com/ansible-book
5. 現代 IT ⼈人⼀一定要知道的 Ansible ⾃自動化組態技巧 / 3e - https://goo.gl/vHyVDt
6. 現代 IT ⼈人⼀一定要知道的 Ansible ⾃自動化組態技巧系列列⽂文章 - https://goo.gl/EOjs4I
7. Getting started with GitLab CI | GitLab Documentation - https://goo.gl/NctsCk
8. Demo project of COSCUP 2017 - https://gitlab.com/chusiang/coscup2017-cd-demo
114
圖片來來源
• 《Continuous Delivery》 | Amazon.com - https://www.amazon.com/dp/0321601912
• 《Continuous Delivery 中⽂文版》 | 天瓏網路路書店 - https://goo.gl/SK745B
• DevOps Services & Continuous Delivery - https://goo.gl/jswxch
• 《The Phoenix Project》 | Amazon.com - https://goo.gl/visckK
• Resenha: Harry Potter e a Pedra Filosofal, de J.K. Rowling | Acrobata das Letras

- https://goo.gl/R34tSA
• Brown Book Icon | SoftIcons.com - https://goo.gl/U9U2am
• Always Agile Consulting · Introducing Continuous Delivery - https://goo.gl/2Nhtcr
• 5 CI/CD Strategies for Faster Software Deployments and Better Automation | snap

- https://goo.gl/UZPf5e
115
http://s.drx.tw/cd
DevOps Taiwan
https://www.facebook.com/groups/DevOpsTaiwan/
https://devopstaiwan.slack.com/
https://gitter.im/DevOpsTW/
Ansible Taiwan
https://telegram.me/ansible_tw
https://github.com/ansible-tw
http://ansible.tw
http://萍⽔水相逢.tw
119
Q & A
嚴禁拍打餵食
120
END

More Related Content

PDF
Continuous Delivery Workshop with Ansible x GitLab CI
PDF
Continuous Delivery Workshop with Ansible x GitLab CI (3rd)
PDF
Continuous Delivery Workshop with Ansible x GitLab CI (2nd)
PDF
Automate with Ansible basic (2/e)
PDF
Continuous Delivery with Ansible x GitLab CI (2e)
PDF
前端工程師一定要知道的 Docker 虛擬化容器技巧
PPTX
Docker 基礎介紹與實戰
PDF
Automate with Ansible basic (3/e)
Continuous Delivery Workshop with Ansible x GitLab CI
Continuous Delivery Workshop with Ansible x GitLab CI (3rd)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd)
Automate with Ansible basic (2/e)
Continuous Delivery with Ansible x GitLab CI (2e)
前端工程師一定要知道的 Docker 虛擬化容器技巧
Docker 基礎介紹與實戰
Automate with Ansible basic (3/e)

What's hot (20)

PDF
從軟體開發角度
談 Docker 的應用
PDF
Git and Github basic with SourceTree
PDF
20150604 docker 新手入門
PDF
AWS EC2 for beginner
PDF
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows
PPT
Software Engineer Talk
PDF
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
PDF
docker intro
PPTX
DevOpsDays Taipei 2018 - Puppet 古早味、新感受:改造老牌企業進入自動化時代
PDF
PDF
認識那條鯨魚 Docker 初探
PDF
Introduction to Golang final
PPTX
Docker 淺入淺出
PPTX
Docker tutorial
PDF
Yet another introduction to Git - from the bottom up
PPTX
用 Docker 改善團隊合作模式
PDF
COSCUP 2016 Workshop: 用 Docker 架設班級 git-it 練習環境
PDF
Git in a nutshell
PDF
Visual Studio Code 快速上手指南
PDF
Docker Build
從軟體開發角度
談 Docker 的應用
Git and Github basic with SourceTree
20150604 docker 新手入門
AWS EC2 for beginner
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows
Software Engineer Talk
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
docker intro
DevOpsDays Taipei 2018 - Puppet 古早味、新感受:改造老牌企業進入自動化時代
認識那條鯨魚 Docker 初探
Introduction to Golang final
Docker 淺入淺出
Docker tutorial
Yet another introduction to Git - from the bottom up
用 Docker 改善團隊合作模式
COSCUP 2016 Workshop: 用 Docker 架設班級 git-it 練習環境
Git in a nutshell
Visual Studio Code 快速上手指南
Docker Build
Ad

Similar to Continuous Delivery with Ansible x GitLab CI (20)

PDF
現代 IT 人一定要知道的 Ansible 自動化組態技巧
PPTX
Ansible 101
PDF
Continuous Delivery Workshop with Ansible x GitLab CI (5th)
PDF
Ansible introduction
PDF
Is it really easy for companies to import Ansible automation
ODP
GNU Build System
PDF
ansible
PDF
跟著 geerlingguy 大神
一起測試 Ansible Roles
PPTX
20121111 linux intro
PPT
20030623 linuxbasic and-security
PDF
My DevOps Tour 0.1
PDF
makefile20141121
PDF
Ansible & GitLab CI / CD Workshop 101 ( @Agile Tour Taipei 2017)
PDF
Testing in Production, Deploy on Fridays
PDF
[DevOpsDays] 硬體產業的DevOps導入與實踐 - 以工控產業為例
PDF
該怎麼樣(認真的)部署你的 Python Web 應用程式?
PDF
DevOps Taiwan CICD Pipeline Tools
ODP
新北市教師工作坊 -- Bash script programming 介紹
PDF
Bitbucket pipeline CI
現代 IT 人一定要知道的 Ansible 自動化組態技巧
Ansible 101
Continuous Delivery Workshop with Ansible x GitLab CI (5th)
Ansible introduction
Is it really easy for companies to import Ansible automation
GNU Build System
ansible
跟著 geerlingguy 大神
一起測試 Ansible Roles
20121111 linux intro
20030623 linuxbasic and-security
My DevOps Tour 0.1
makefile20141121
Ansible & GitLab CI / CD Workshop 101 ( @Agile Tour Taipei 2017)
Testing in Production, Deploy on Fridays
[DevOpsDays] 硬體產業的DevOps導入與實踐 - 以工控產業為例
該怎麼樣(認真的)部署你的 Python Web 應用程式?
DevOps Taiwan CICD Pipeline Tools
新北市教師工作坊 -- Bash script programming 介紹
Bitbucket pipeline CI
Ad

More from Chu-Siang Lai (14)

PDF
My DevOps Tour 2.3
PDF
The System Engineer in Agile Team
PDF
See the Agile from Mindset
PDF
Writing skills for Information Technology
PDF
My DevOps Tour 1.0
PDF
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
PDF
Automate with Ansible basic (2/e, English)
PDF
helloTux 2012
PDF
Unity & Googlizer
PDF
使用 Multi-sites 技術快速建置多 Drupal 網站
PDF
歡迎來到 Ubuntu 9.10 Release Party (台中)
PDF
無痛入門 Chromecast
ODP
Ubuntu 藍星侵略計劃
PDF
Intro of Network, WiFi on Ubuntu
My DevOps Tour 2.3
The System Engineer in Agile Team
See the Agile from Mindset
Writing skills for Information Technology
My DevOps Tour 1.0
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Automate with Ansible basic (2/e, English)
helloTux 2012
Unity & Googlizer
使用 Multi-sites 技術快速建置多 Drupal 網站
歡迎來到 Ubuntu 9.10 Release Party (台中)
無痛入門 Chromecast
Ubuntu 藍星侵略計劃
Intro of Network, WiFi on Ubuntu

Continuous Delivery with Ansible x GitLab CI