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
Day 2 - CI
Search
offz
April 20, 2017
0
54
Day 2 - CI
offz
April 20, 2017
Tweet
Share
More Decks by offz
See All by offz
TM-P2-IT-security
offfffz
0
18
Docker Compose for Rails Developer
offfffz
1
34
Day 2 - Docker
offfffz
0
42
Day 1 - Git
offfffz
0
87
Day 1 - Testing
offfffz
0
46
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
217
8.6k
The Invisible Customer
myddelton
114
12k
Ruby is Unlike a Banana
tanoku
96
10k
What's new in Ruby 2.0
geeforr
338
31k
Build your cross-platform service in a week with App Engine
jlugia
226
17k
Designing Experiences People Love
moore
136
23k
Principles of Awesome APIs and How to Build Them.
keavy
121
16k
What's in a price? How to price your products and services
michaelherold
238
11k
Visualization
eitanlees
137
14k
StorybookのUI Testing Handbookを読んだ
zakiyama
13
4.7k
Docker and Python
trallard
35
2.7k
Designing with Data
zakiwarfel
96
4.8k
Transcript
Continuous Integration
CI ดีอย่างไร 1. ทำงานบ่อย 2. รายงานผลการทำงาน กลับไปที่ Gitlab 3. ทำงานอัตโนมัติ
CI ทำงานอย่างไร 1. เริ่มทำงานเมื่อมี commit ใหม่ใน server 2. clone ทั้ง
project ลงไปที่ runner 3. ทำงานตาม script (unit test, UI test, style test) 4. รายงานสถานะ กลับไปที่ Gitlab
CI ทำให้เรามั่นใจเรื่อง ? - มั่นใจว่า software ทำงานตามที่เราสั่ง - มั่นใจว่ามี test
case ครอบคลุม - มั่นใจว่า performance ดี เร็ว - มั่นใจว่า code สวย
CI ไม่ทำให้เรามั่นใจเรื่อง ? - อย่ามั่นใจว่า software ทำงานถูก - อย่ามั่นใจว่า software
สวย น่าใช้ - อย่ามั่นใจว่า user จะชอบมัน
Workflow
Old Workflow Dev Test Deploy
Automated Flow Dev & Test Script Gitlab Gitlab Runner
Host
Flow Build Image Run Test Rename Tag Run Deploy
Flow Build Image
Flow Run Test
Flow Rename Tag
Flow Run Deploy
Flow Build Image Run Test Rename Tag Run Deploy
Gitlab Runner
Gitlab Runner
Gitlab Runner docker run -d \ --name gitlab-runner \ --restart
always \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /srv/gitlab-runner/config:/etc/gitlab-runner \ gitlab/gitlab-runner:latest
Gitlab Runner docker exec -it gitlab-runner \ gitlab-runner register -n
--url $GITLAB_HOST/ci --registration-token $TOKEN --executor docker --description $DESCRIPTION --docker-image "docker:latest" --docker-privileged
walkthrough 01 1. clone chidchat 2. รัน unit test 3.
รัน UI test
walkthrough 02 1. รัน server ที่ port 5000 2. รัน
client 2 ตัว ให้ connect ไปที่ localhost:5000 3. พิมพ์ code :sob: แล้วกดส่ง
exercise 01 1. เข้าเว็บ https://www.emojicopy.com 2. เลือก emoji มา 1
ตัว และคิด code 3. สร้าง issue ใน gitlab, สร้าง branch และ MR 4. ทำให้ server สามารถอ่าน code แล้วส่งออกมาเป็น emoji ได้ 5. ทำให้ MR อยู่ในสถานะ merge ได้