This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
68 lines (63 loc) · 3.34 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
machine:
java:
version: openjdk8
environment:
ANDROID_SDK_VERSION: 25
BUILD_TOOLS_VERSION: 25.0.2
SUPPORT_VERSION: 25.1.0
PLAY_SERVICES_VERSION: 10.0.1
# Disable emulator audio
QEMU_AUDIO_DRV: none
services:
- docker
dependencies:
pre:
# Although the Android Gradle plugin claims to install SDK components
# (https://developer.android.com/studio/intro/update.html#download-with-gradle), it's still rife with shittiness
# (e.g. http://stackoverflow.com/a/38381577/129570 and https://code.google.com/p/android/issues/detail?id=230654).
# Thus we install the SDK and tooling components manually.
- if [ ! -d "${ANDROID_HOME}/platforms/android-${ANDROID_SDK_VERSION}" ]; then echo y | android update sdk --no-ui --all --filter "platform-tools,android-${ANDROID_SDK_VERSION}"; fi
- if [ ! -d "${ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION}" ]; then echo y | android update sdk --no-ui --all --filter "build-tools-${BUILD_TOOLS_VERSION}"; fi
- if [ ! -d "${ANDROID_HOME}/extras/android/m2repository/com/android/support/design/${SUPPORT_VERSION}" ]; then echo y | android update sdk --no-ui --all --filter "extra-android-m2repository"; fi
- if [ ! -d "${ANDROID_HOME}/extras/google/m2repository/com/google/android/gms/play-services/${PLAY_SERVICES_VERSION}" ]; then echo y | android update sdk --no-ui --all --filter "extra-google-m2repository"; fi
override:
- ./gradlew resolveConfigurations --parallel --console=plain
cache_directories:
# CircleCI seems to not expand env vars for cache_directories (https://discuss.circleci.com/t/variable-substitution-does-not-work-for-cache-directories/9080)
- /usr/local/android-sdk-linux/platforms/android-25
- /usr/local/android-sdk-linux/platform-tools
- /usr/local/android-sdk-linux/build-tools/25.0.2
- /usr/local/android-sdk-linux/extras/android/m2repository
- /usr/local/android-sdk-linux/extras/google/m2repository
test:
pre:
- emulator -avd circleci-android24 -no-window:
background: true
parallel: true
- circle-android wait-for-boot
- echo ${ZIGGY_KEYSTORE} | base64 --decode > ${HOME}/release-key.jks # APK signing key is in this keystore
override:
# Test the app
- ./gradlew connectedInternalDebugAndroidTest
# This is needed to free up memory on circle when we're done
- adb devices | grep emulator | cut -f1 | while read line; do adb -s $line emu kill; done
- ./gradlew check assembleInternalRelease --parallel --info --console=plain
post:
- mkdir -p ${CIRCLE_TEST_REPORTS}/junit/
- find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ${CIRCLE_TEST_REPORTS}/junit/ \;
deployment:
play_store:
branch: develop
commands:
- curl https://raw.githubusercontent.com/quartictech/circleci-utils/develop/circleci-gcloud-login | bash
- echo ${GOOGLE_PLAY_SERVICE_KEY} | base64 --decode > ${HOME}/google-play-service-key.json
# Note we can change to publishRelease once we have the play store content in repo
- ./gradlew dockerPush publishApkRealRelease --parallel --info --console=plain
docker_push:
branch: /.*/
commands:
- curl https://raw.githubusercontent.com/quartictech/circleci-utils/develop/circleci-gcloud-login | bash
- ./gradlew dockerPush --parallel --info --console=plain
general:
artifacts:
- app/build/outputs