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
GitHub Copilotは開発者の生産性をどれだけ上げるのか?ZOZOでの全社導入とその効果 / How Much Does GitHub Copilot Improve Developer Productivity? The Company-wide Implementation and Its Effects at ZOZO
horie1024
35
23k
ZOZOTOWNにおける開発生産性向上に関する取り組み / Initiatives to Improve Development Productivity at ZOZOTOWN
horie1024
8
5.8k
How does the Relay connect Android app development and Design?
horie1024
2
1.8k
既存画面の 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
ZOZOTOWNでの Dagger Hilt対応について/Migration to Dagger Hilt at ZOZOTOWN.
horie1024
1
2k
Other Decks in Programming
See All in Programming
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
320
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
3
430
Better Code Design in PHP
afilina
PRO
0
120
Macとオーディオ再生 2024/11/02
yusukeito
0
350
CSC509 Lecture 09
javiergs
PRO
0
140
推し活の ハイトラフィックに立ち向かう Railsとアーキテクチャ - Kaigi on Rails 2024
falcon8823
6
2.8k
CSC509 Lecture 11
javiergs
PRO
0
180
Tauriでネイティブアプリを作りたい
tsucchinoko
0
360
外部システム連携先が10を超えるシステムでのアーキテクチャ設計・実装事例
kiwasaki
1
280
Googleのテストサイズを活用したテスト環境の構築
toms74209200
0
310
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
170
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
470
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Facilitating Awesome Meetings
lara
50
6.1k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Unsuck your backbone
ammeep
668
57k
Into the Great Unknown - MozCon
thekraken
32
1.5k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
The Language of Interfaces
destraynor
154
24k
Docker and Python
trallard
40
3.1k
Become a Pro
speakerdeck
PRO
25
5k
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