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
AndroidのCIを始めよう
Search
Ryosuke Horie
August 10, 2016
Programming
1
2k
AndroidのCIを始めよう
Ryosuke Horie
August 10, 2016
Tweet
Share
More Decks by Ryosuke Horie
See All by Ryosuke Horie
Miro × ZOZO ZOZOのMiro活用事例紹介
horie1024
0
110
GitHub Copilotは開発者の生産性をどれだけ上げるのか?ZOZOでの全社導入とその効果 / How Much Does GitHub Copilot Improve Developer Productivity? The Company-wide Implementation and Its Effects at ZOZO
horie1024
35
24k
ZOZOTOWNにおける開発生産性向上に関する取り組み / Initiatives to Improve Development Productivity at ZOZOTOWN
horie1024
8
6k
How does the Relay connect Android app development and Design?
horie1024
2
1.9k
既存画面の Jetpack Composeでの書き換え: FAANSでの事例紹介 / Case study of rewriting existing screens with Jetpack Compose
horie1024
0
1.6k
スキルマップを作った話 / Create a skills map
horie1024
3
4.4k
Miroを使った開発効率向上のための取り組み / Using Miro Efforts to Improve Development Efficiency
horie1024
0
2.3k
ktlintカスタムルールのパッケージ化と再利用/Package and reuse ktlint custom rules
horie1024
1
1.1k
Jetpack Benchmarkでの ViewのInflateパフォーマンスの可視化と改善 / The Jetpack Benchmark. Visualizing and improving View Inflate performance
horie1024
3
1.1k
Other Decks in Programming
See All in Programming
As an Engineers, let's build the CRM system via LINE Official Account 2.0
clonn
1
670
あれやってみてー駆動から成長を加速させる / areyattemite-driven
nashiusagi
1
200
fs2-io を試してたらバグを見つけて直した話
chencmd
0
200
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
260
似たもの同士のPerlとPHP
uzulla
1
120
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
180
急成長期の品質とスピードを両立するフロントエンド技術基盤
soarteclab
0
900
Thoughts and experiences on Rust and TypeScript
unvalley
2
230
42 best practices for Symfony, a decade later
tucksaun
1
170
iOS18とヘルスケアの睡眠対応
takuyaosawa
0
110
Haze - Real time background blurring
chrisbanes
1
500
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
160
Featured
See All Featured
The Language of Interfaces
destraynor
154
24k
For a Future-Friendly Web
brad_frost
175
9.4k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
KATA
mclloyd
29
14k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
Side Projects
sachag
452
42k
Rails Girls Zürich Keynote
gr2m
94
13k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Transcript
AndroidͷCIΛ࢝ΊΑ͏ VASILY,(Inc.(ງߐ 2016/8/7(Android(Φʔϧελʔζ(2 ©"VASILY,"Inc.,"2016 1
About&Me • Ryosuke)Horie)@Horie1024 • →)ͷௗͷΞΠίϯͰ͢ • Android)Developer • VASILY,)Inc. ©"VASILY,"Inc.,"2016
2
©"VASILY,"Inc.,"2016 3
ൃදͷྲྀΕ • CIͱʁ • CIΛ࣮ݱ͢ΔͨΊͷΈ • όʔδϣϯཧγεςϜͷར༻ • AndroidͷϏϧυεΫϦϓτ •
CIαʔόʔͷߏங • iQONͰͷCIಋೖࣄྫ ©"VASILY,"Inc.,"2016 4
CI? ©"VASILY,"Inc.,"2016 5
Con$nuous'Integra$on ܧଓతΠϯςάϨʔγϣϯ ©"VASILY,"Inc.,"2016 6
ΠϯςάϨʔγϣϯ? ©"VASILY,"Inc.,"2016 7
ΠϯςάϨʔγϣϯ • ݸʑͷιʔείʔυ͕શମͱͯ͠ػೳ͢Δ͔Λ֬ೝ͢ΔͨΊʹ Ұͭʹ౷߹͢Δ͜ͱ1 1"ϙʔϧɾMɾσϡόϧɺεςΟʔϒɾMɾϚςΟΞεɺΞϯυϦϡʔɾΫϩʔόʔ."ܧଓతΠϯςάϨʔγϣϯೖ ."ܦBPࣾ,"2009,"p."49 ©"VASILY,"Inc.,"2016 8
CIͱʁ • ΠϯςάϨʔγϣϯΛܧଓతʹසൟʹߦ͏ϓϥΫςΟε ©"VASILY,"Inc.,"2016 9
CIͱʁ • ΠϯςάϨʔγϣϯΛܧଓతʹසൟʹߦ͏ϓϥΫςΟε • ιϑτΣΞʹ͍ͭͯͷϑΟʔυόοΫΛड͚Δػձͷ૿Ճ • ෆ۩߹ͷࠞೖ͔Βमਖ਼·Ͱͷ࣌ؒॖ • ιϑτΣΞશମͷ࣭ͷ্ ©"VASILY,"Inc.,"2016
10
CIΛ࣮ݱ͢ΔͨΊͷΈ ©"VASILY,"Inc.,"2016 11
CIΛߦ͏ʹʁ • ΠϯςάϨʔγϣϯ͕؆୯ʹ࣮ߦͰ͖Δඞཁ͕͋Δ ©"VASILY,"Inc.,"2016 12
ΠϯςάϨʔγϣϯͷϓϩηε • ίϯύΠϧ • ੩తղੳ • ςετͳͲ ͜ΕΒͷҰ࿈ͷϓϩηεΛʮϏϧυʯͱݺͿ2 2"ϙʔϧɾMɾσϡόϧɺεςΟʔϒɾMɾϚςΟΞεɺΞϯυϦϡʔɾΫϩʔόʔ."ܧଓతΠϯςάϨʔγϣϯೖ ."ܦBPࣾ,"2009,"p."26
©"VASILY,"Inc.,"2016 13
ΠϯςάϨʔγϣϯͷࣗಈԽ • ΠϯςάϨʔγϣϯΛϏϧυεΫϦϓτʹΑͬͯࣗಈԽ • ίϚϯυҰͭͰϏϧυΛ࣮ߦͰ͖ΔΑ͏ʹ͢Δ ©"VASILY,"Inc.,"2016 14
CI#(ܧଓతΠϯςάϨʔγϣϯ) • ιʔείʔυͷมߋΛىʹϏϧυεΫϦϓτΛ࣮ߦ • ϏϧυΛৗతʹසൟʹ࣮ߦ͍ͯ͘͠ ©"VASILY,"Inc.,"2016 15
CIͷྲྀΕ 1. ϦϙδτϦͷมߋΛࢹ 2. มߋ͕͋ΕιʔείʔυΛνΣοΫΞτ 3. Ϗϧυͷ࣮ߦ 4. ࣮ߦ݁ՌΛϑΟʔυόοΫ 5.
Ҿ͖ଓ͖ϦϙδτϦͷมߋΛࢹ ©"VASILY,"Inc.,"2016 16
CIʹඞཁͳཁૉ • όʔδϣϯཧγεςϜ • ϏϧυεΫϦϓτ • CIαʔόʔ ©"VASILY,"Inc.,"2016 17
CIʹඞཁͳཁૉ • όʔδϣϯཧγεςϜ • ιʔείʔυΛूɾཧ • ϏϧυεΫϦϓτ • ϏϧυͷࣗಈԽ •
CIαʔόʔ • ιʔείʔυͷมߋͷࢹɺϏϧυͷ࣮ߦɺϑΟʔυόοΫ ©"VASILY,"Inc.,"2016 18
όʔδϣϯཧγεςϜͷར༻ ©"VASILY,"Inc.,"2016 19
όʔδϣϯཧγεςϜͷར༻ • ιʔείʔυΛूɾཧ • ιʔείʔυͷมߋΛىʹCIΛ࣮ߦՄೳʹ͢Δ ©"VASILY,"Inc.,"2016 20
όʔδϣϯཧγεςϜͷར༻ • όʔδϣϯཧγεςϜΛ༻ • GitͳͲ • ϦϙδτϦཧαʔϏεɾπʔϧʹΑͬͯίʔυΛू • GitHub,)Bitbucket,)GitlabͳͲ ©"VASILY,"Inc.,"2016
21
AndroidͷϏϧυεΫϦϓτ ©"VASILY,"Inc.,"2016 22
AndroidͷϏϧυεΫϦϓτ • ϏϧυεΫϦϓτॏཁ • ΠϯςάϨʔγϣϯϏϧυεΫϦϓτʹΑͬͯࣗಈԽ • ϏϧυεΫϦϓτ͕ແ͍ͱCIΛ࣮ߦͰ͖ͳ͍ ©"VASILY,"Inc.,"2016 23
AndroidͷϏϧυεΫϦϓτ • AndroidStudioͷొ • Eclipse͔ΒAndroidStudio։ൃڥ͕Ҡߦ ©"VASILY,"Inc.,"2016 24
• Ϗϧυπʔϧ͕GradleҠߦ • ϓϩδΣΫτߏ͕Gradleϕʔεʹ • IDEͱϏϧυϓϩηεͷ • CLIͰͷ࣮ߦ͕༰қʹ ©"VASILY,"Inc.,"2016 25
AndroidͷϏϧυεΫϦϓτ • Android(Gradle(Plugin͕ΠϯςάϨʔγϣϯΛࣗಈԽ • ΠϯςάϨʔγϣϯͷϓϩηε͕Gradleͷtaskͱͯ͠ఆٛ ©"VASILY,"Inc.,"2016 26
Android'Tasks3 • assemble The%task%to%assemble%the%output(s)%of%the%project. • check The%task%to%run%all%the%checks. • connectedCheck Runs%checks%that%requires%a%connected%device%or%emulator.%they%will%run%on%all%connected%devices%in%parallel.
• deviceCheck Runs%checks%using%APIs%to%connect%to%remote%devices.%This%is%used%on%CI%servers. • build This%task%does%both%assemble%and%check • clean This%task%cleans%the%output%of%the%project. 3"Gradle"Plugin"User"Guide:"Android3tasks ©"VASILY,"Inc.,"2016 27
Android'Tasksͷґଘؔ • ./gradlew tasks --allͰλεΫͷґଘؔΛදࣔ app:assemble - [app:assembleDebug, app:assembleRelease] app:check
- [app:lint, app:test] app:connectedCheck - [app:connectedAndroidTest] app:deviceCheck - [app:deviceAndroidTest] app:build - [app:assemble, app:check] app:clean - [] ©"VASILY,"Inc.,"2016 28
ΠϯςάϨʔγϣϯͷϓϩηε • ίϯύΠϧ • ੩తղੳ • ςετ ©"VASILY,"Inc.,"2016 29
Android'TasksͱͷରԠ • ίϯύΠϧ"→"./gradlew*assemble • ੩తղੳ"→"./gradlew*lint • ςετ"→"./gradlew*test,*connectedCheck,*deviceCheck • ίϯύΠϧ"+"੩తղੳ"+"ςετ"→"./gradlew*build ©"VASILY,"Inc.,"2016
30
AndroidͷCIΛߦ͏४උͰ͖͍ͯΔ • GradleϕʔεͷϓϩδΣΫτͰGradle(Plugin͕ϏϧυεΫϦ ϓτΛ༻ҙ • ༻ҙ͞ΕͨϏϧυεΫϦϓτΛ࣮ߦ͢Δ͜ͱͰAndroidϓϩδΣ ΫτΛϏϧυ ©"VASILY,"Inc.,"2016 31
ΠϯςάϨʔγϣϯͷϓϩηε • ίϯύΠϧ • ੩తղੳ • ςετͳͲ ͜ΕΒͷҰ࿈ͷϓϩηεΛʮϏϧυʯͱݺͿ ©"VASILY,"Inc.,"2016 32
Ϗϧυͷ࣮ߦ • ΠϯςάϨʔγϣϯͷϓϩηεશ࣮ͯߦ͖͔͢ʁ • ࠷ऴతʹશͯͷϓϩηεͷ࣮ߦΛࢦ͢ ©"VASILY,"Inc.,"2016 33
Ϗϧυͷ࣮ߦ • CIಋೖͷॳظίϯύΠϧ͔Β࢝ΊΔͱ༰қ • ීஈͷ։ൃͷӨڹ͕খ͍͞ • CI͕ఆணޙʹ੩తղੳɺςετͳͲͷϓϩηεΛՃ • νʔϜ͕CIʹͳΕ͔ͯΒஈ֊తʹϓϩηεΛՃ ©"VASILY,"Inc.,"2016
34
CIαʔόʔͷߏங ©"VASILY,"Inc.,"2016 35
CIαʔόʔͷߏங • CIπʔϧCIαʔϏεΛ͍CIαʔόʔΛ༻ҙ • ϦϙδτϦΛࢹɺมߋ͕͋ΕϏϧυεΫϦϓτΛ࣮ߦ • ࣮ߦ݁ՌΛϑΟʔυόοΫ ©"VASILY,"Inc.,"2016 36
CIαʔόʔͷߏங • ༷ʑͳCIαʔόʔΛߏங͢ΔαʔϏεɺπʔϧ͕ଘࡏ ©"VASILY,"Inc.,"2016 37
CircleCIͰͷCIͷ࣮ߦ • CircleCIΛCIαʔόʔʹͨ͠߹ͷྫ • ରͷϦϙδτϦΛࢹ • assembleλεΫΛ࣮ߦ ©"VASILY,"Inc.,"2016 38
ϦϙδτϦͷมߋΛࢹ • ࠨͷϝχϡʔ͔ΒʮADD$PROJECTSʯ Λબ • ʮorganiza4onʯΛબ ©"VASILY,"Inc.,"2016 39
ϦϙδτϦͷมߋΛࢹ • ରͷϦϙδτϦͷʮBuild'projectʯΛΫϦοΫ • ϦϙδτϦͷมߋͷࢹ͕։࢝͞ΕΔ ©"VASILY,"Inc.,"2016 40
circle.yml • ࣮ߦ͢ΔϏϧυ༰Λఆٛ machine: java: version: openjdk8 environment: ANDROID_HOME: /usr/local/android-sdk-linux
dependencies: override: - echo y | android update sdk --no-ui --all --filter "tools" - echo y | android update sdk --no-ui --all --filter "android-24,build-tools-24.0.1" test: override: - ./gradlew assemble ©"VASILY,"Inc.,"2016 41
ϏϧυεΫϦϓτͷ࣮ߦ • assembleλεΫΛ࣮ߦ test: override: - ./gradlew assemble ©"VASILY,"Inc.,"2016 42
༷ʑͳCIαʔϏεɾπʔϧ • Bitrise • CircleCI • Travis/CI • Wercker •
GREENHOUSE • Jenkins ©"VASILY,"Inc.,"2016 43
ϦϙδτϦͷࢹͱϏϧυεΫϦϓτͷ࣮ߦ ©"VASILY,"Inc.,"2016 44
iQONͰͷCIಋೖࣄྫ ©"VASILY,"Inc.,"2016 45
iQONͷ։ൃϑϩʔ • PullRequestϕʔεͷ։ൃ • releaseϒϥϯνʹରͯ͠PullRequest • masterϚʔδͯ͠ϦϦʔε ©"VASILY,"Inc.,"2016 46
CIશମͷྲྀΕ4 4"AndroidͷCIڥΛCircleCI͔ΒWerckerʹҠߦ͠·ͨ͠ ©"VASILY,"Inc.,"2016 47
CIͷಋೖ • QA༻APKͷϝʔϧͰͷΛվળ • CircleCIΛಋೖ • ΠϯςάϨʔγϣϯͷίϯύΠϧϓϩηε͔ΒCIΛ։࢝ • assembleλεΫͷ࣮ߦͱDeployGateͰͷ5 5"CircleCIͱDeployGateͰAndroidΞϓϦͷϦϦʔε࡞ۀΛࣗಈԽͯ͠Έͨ"
©"VASILY,"Inc.,"2016 48
CIΛಋೖͨ͠ޮՌ • ఆܕͷ܁Γฦ͠࡞ۀͷݮ" • ࣾQAͷޮ্͕ • ࣾͷCIͷఆண ©"VASILY,"Inc.,"2016 49
AndroidͷCI͍͠ʁ • AndroidͷΠϯςάϨʔγϣϯطʹࣗಈԽ͞Ε͍ͯΔ • CIπʔϧɺCIαʔϏεͷਐԽ • ؆୯ʹCIαʔόΛߏஙͰ͖ΔΑ͏ʹͳ͍ͬͯΔ ©"VASILY,"Inc.,"2016 50
·ͱΊ • AndroidͷCI͘͠ͳ͍ • AndroidͷCIΛ࢝ΊΑ͏ ©"VASILY,"Inc.,"2016 51
͋Γ͕ͱ͏͍͟͝·ͨ͠ ©"VASILY,"Inc.,"2016 52