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
960
GitHub Copilotは開発者の生産性をどれだけ上げるのか?ZOZOでの全社導入とその効果 / How Much Does GitHub Copilot Improve Developer Productivity? The Company-wide Implementation and Its Effects at ZOZO
horie1024
36
24k
ZOZOTOWNにおける開発生産性向上に関する取り組み / Initiatives to Improve Development Productivity at ZOZOTOWN
horie1024
8
6.1k
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.4k
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
Внедряем бюджетирование, или Как сделать хорошо?
lamodatech
0
910
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
1.3k
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
340
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
920
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
180
React 19でお手軽にCSS-in-JSを自作する
yukukotani
5
550
情報漏洩させないための設計
kubotak
5
1.3k
快速入門可觀測性
blueswen
0
490
2025.01.17_Sansan × DMM.swift
riofujimon
2
350
ATDDで素早く安定した デリバリを実現しよう!
tonnsama
1
1.5k
テストケースの名前はどうつけるべきか?
orgachem
PRO
1
290
20241217 競争力強化とビジネス価値創出への挑戦:モノタロウのシステムモダナイズ、開発組織の進化と今後の展望
monotaro
PRO
0
250
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Designing for Performance
lara
604
68k
Designing Experiences People Love
moore
139
23k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
A better future with KSS
kneath
238
17k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.4k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.8k
RailsConf 2023
tenderlove
29
970
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