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
CircleCIを使ったAndroidの開発フローの効率化とtips
Search
ymnder
May 28, 2019
Technology
1
1.2k
CircleCIを使ったAndroidの開発フローの効率化とtips
CircleCI ユーザーコミュニティミートアップ #4 2019/5/28 @ymnd
https://circleci.connpass.com/event/125622/
ymnder
May 28, 2019
Tweet
Share
More Decks by ymnder
See All by ymnder
What’s new in Google Play's billing system
ymnder
1
170
Deep Linksをはじめよう
ymnder
0
320
Introduction to Wear OS Application Development
ymnder
0
450
Introduction to new features of Google Play Billing
ymnder
2
280
運用から学ぶPlay Billing Library
ymnder
2
720
What’s new in Google Play Billing v1.2
ymnder
0
680
詳解定期購入
ymnder
7
6k
社内向けライブラリを設計・運用する話
ymnder
0
950
What’s new in Google Play Billing
ymnder
2
2k
Other Decks in Technology
See All in Technology
一休.comレストランにおけるRustの活用
kymmt90
3
580
ガバメントクラウド単独利用方式におけるIaC活用
techniczna
3
270
CAMERA-Suite: 広告文生成のための評価スイート / ai-camera-suite
cyberagentdevelopers
PRO
3
270
新卒1年目が挑む!生成AI × マルチエージェントで実現する次世代オンボーディング / operation-ai-onboarding
cyberagentdevelopers
PRO
1
170
IaC運用を楽にするためにCDK Pipelinesを導入したけど、思い通りにいかなかった話
smt7174
1
110
ネット広告に未来はあるか?「3rd Party Cookie廃止とPrivacy Sandboxの効果検証の裏側」 / third-party-cookie-privacy
cyberagentdevelopers
PRO
1
130
10分でわかるfreee エンジニア向け会社説明資料
freee
18
520k
Gradle: The Build System That Loves To Hate You
aurimas
2
150
visionOSでの空間表現実装とImmersive Video表示について / ai-immersive-visionos
cyberagentdevelopers
PRO
1
110
新卒1年目が向き合う生成AI事業の開発を加速させる技術選定 / ai-web-launcher
cyberagentdevelopers
PRO
7
1.5k
2024-10-30-reInventStandby_StudyGroup_Intro
shinichirokawano
1
630
来年もre:Invent2024 に行きたいあなたへ - “集中”と“つながり”で楽しむ -
ny7760
0
470
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
264
13k
Speed Design
sergeychernyshev
24
570
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
The Language of Interfaces
destraynor
154
24k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
14
1.9k
Building Better People: How to give real-time feedback that sticks.
wjessup
363
19k
How to Ace a Technical Interview
jacobian
275
23k
What's in a price? How to price your products and services
michaelherold
243
12k
RailsConf 2023
tenderlove
29
880
Visualization
eitanlees
144
15k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
7
150
How to Think Like a Performance Engineer
csswizardry
19
1.1k
Transcript
CircleCI Android tips CircleCI #4 2019/5/28 @ymnd
whoami twitter:@ymnd, GitHub:@ymnder Application Engineer Android Android : https://riconken.bitbucket.io/hifumi/
Circle CI . CI Private repository Danger CI CI
CircleCI . 2018 CircleCI . v . 15 push waiting
v . ~ ↗↗↗
[CI] local -> GitHub -> CircleCI [CD] local -> Fabric
Beta
CircleCI CD gradle Beta CD QA apk 1.0 master apk
CircleCI A: UnitTest gradle-git-repo-plugin B: Danger
CircleCI private repository
CircleCI private repository private CircleCI UnitTest submodule gradle-git-repo-plugin
submodule git submodule update init
gradle-git-repo-plugin private private aar git clone ~/.gitRepos/ ~/.gitRepos/ https://qiita.com/kgmyshin/items/ f
c c fbd https://qiita.com/shimada_takuya/items/ e b ae f ad a
gradle-git-repo-plugin fork grgit GitHub https://blog.github.com/ - - -weak-cryptographic- standards-removed/
gradle-git-repo-plugin //build.gradle dependencies { classpath 'com.github.atsushi-ageet:gradle-git-repo-plugin:2.0.4' } //app/build.gradle apply plugin:
'git-repo' repositories { // Username repository name branch directory github("Nikkei", "KaizenRequest_Android", "master", "repository") } dependencies { implementation ('com.nikkei:kaizenrequest:1.4.1') { }
gradle-git-repo-plugin Circle CI version: 2 jobs: build: working_directory: ~/code docker:
- image: circleci/android:api-28 environment: _JAVA_OPTIONS: -Xms512m -Xmx1024m steps: - checkout - add_ssh_keys: fingerprints: - “ssh_key” - run: cp ssh_config ~/.ssh/config - run: git clone
[email protected]
:ymnder/Hoge.git ~/.gitRepos/ymnder/hoge_library - run: name: Run Unit Test command: ./gradlew testReleaseUnitTest -Poffline
gradle-git-repo-plugin Circle CI version: 2 jobs: build: working_directory: ~/code docker:
- image: circleci/android:api-28 environment: _JAVA_OPTIONS: -Xms512m -Xmx1024m steps: - checkout - add_ssh_keys: fingerprints: - “ssh_key” - run: cp ssh_config ~/.ssh/config - run: git clone
[email protected]
:ymnder/Hoge.git ~/.gitRepos/ymnder/hoge_library - run: name: Run Unit Test command: ./gradlew testReleaseUnitTest -Poffline
gradle-git-repo-plugin Circle CI CI Deploy Keys current branch ssh key
!= library ssh key add_ssh_keys GitHub(deploy keys) -> CircleCI(SSH Permissions)
gradle-git-repo-plugin Circle CI version: 2 jobs: build: working_directory: ~/code docker:
- image: circleci/android:api-28 environment: _JAVA_OPTIONS: -Xms512m -Xmx1024m steps: - checkout - add_ssh_keys: fingerprints: - “ssh_key” - run: cp ssh_config ~/.ssh/config - run: git clone
[email protected]
:ymnder/Hoge.git ~/.gitRepos/ymnder/hoge_library - run: name: Run Unit Test command: ./gradlew testReleaseUnitTest -Poffline
gradle-git-repo-plugin Circle CI //ssh_config Host Hoge-Android HostName github.com User git
IdentityFile /home/circleci/.ssh/id_hoge Host Fuga-Android HostName github.com User git IdentityFile /home/circleci/.ssh/id_hoge - run: git clone git@Hoge-Android:ymnder/Hoge.git ~/.gitRepos/hoge_library - run: git clone git@Fuga-Android:ymnder/Fuga.git ~/.gitRepos/fuga_library
gradle-git-repo-plugin Circle CI repository clone ssh_con g clone
gradle-git-repo-plugin Circle CI version: 2 jobs: build: working_directory: ~/code docker:
- image: circleci/android:api-28 environment: _JAVA_OPTIONS: -Xms512m -Xmx1024m steps: - checkout - add_ssh_keys: fingerprints: - “ssh_key” - run: cp ssh_config ~/.ssh/config - run: git clone
[email protected]
:ymnder/Hoge.git ~/.gitRepos/ymnder/hoge_library - run: name: Run Unit Test command: ./gradlew testReleaseUnitTest -Poffline
gradle-git-repo-plugin Circle CI Test gradle -Po ine git-repo-plugin GitHub private
repository
Danger (Ruby) CI Pull Requests
Danger plugin issue issue Milestone WIP Lint
Danger APK https://github.com/jmatsu/danger-apkstats
Danger Gem le gem install bundle bundle init Gem le
# Gemfile gem 'danger' gem 'danger-android_lint' gem 'danger-apkstats'
Danger Gem le lock bundle install Danger le ### lint
android_lint.gradle_task = "lintDebug -Poffline" android_lint.report_file = "path/app/build/reports/lint-results-Debug.xml" android_lint.filtering = true android_lint.lint(inline_mode: true) ### stats apkstats.command_type=:apk_analyzer apkstats.apk_filepath='~/app-debug.apk' apkstats.compare_with('~/old-app-debug.apk', do_report: true)
Danger android_lint. ltering lint https://github.com/loadsmart/danger-android_lint/blob/ c bf b aa c
b a a bd af /lib/ android_lint/plugin.rb#L
Danger .circleci/con g.yml images Ruby - save_cache: paths: - ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} - restore_cache: key: gems-{{ checksum "Gemfile.lock" }} - run: bundle install --path vendor/bundle - save_cache: paths: - vendor/bundle key: gems-{{ checksum "Gemfile.lock" }} # make app - run: name: Run danger command: bundle exec danger
Danger GitHub Personal access tokens https://github.com/settings/tokens Private repository [repo] bot
CircleCI Environment Variables DANGER_GITHUB_API_TOKEN
Danger PR
CI Danger library permission CD 策 internal app sharing
: images licenses accepted 策 1 circleci/android:api- X-alpha image SDK
docker gradle > Android Platform SDK license not accepted https://discuss.circleci.com/t/android-platform- -sdk- license-not-accepted/
: images licenses accepted .circle/con g.yml run: yes | sdkmanager
--licenses || exit run: yes | sdkmanager --update || exit https://discuss.circleci.com/t/android-platform- -sdk- license-not-accepted/ /
: images licenses accepted release circleci/android:api- X alpha images
https://speakerdeck.com/jmatsu/cd-based-on- droidkaigi- -app-e ae-fe - -b -e e fbaf d
https://qiita.com/noboru_i/items/f b b d https://qiita.com/noboru_i/items/ ad c d b c eb b https://qiita.com/hkusu/items/e bd efa f http://tech.connehito.com/entry/danger https://techblog.lclco.com/entry/ / / /