-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
198 lines (181 loc) · 4.83 KB
/
.gitlab-ci.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
#image: registry.coinninja.net/engineering/android-sdk:latest
image: registry.coinninja.net/engineering/android-ndk:tooling-update
variables:
GRADLE_USER_HOME: $CI_PROJECT_DIR/.gradle
GRADLE_OPTS: "-Dorg.gradle.daemon=true"
stages:
- test
- build
- deploy
before_script:
- chmod +x ./gradlew
- ./gradlew --version
- ./gradlew --status
- export ANDROID_HOME=/sdk-tools/
- export PATH=$PATH:/sdk-tools/platform-tools/
- export APP_VERSION=`./sh/appversion_lookup.sh $HOCKEY_APP_API_TOKEN`
- echo $APP_VERSION
- echo "${__google_services_json}" | base64 -d > ./app/google-services.json
cache:
key: ${CI_PROJECT_ID}
paths:
- .gradle/
.build_and_sign: &build_and_sign
before_script:
- export APP_VERSION=`./sh/appversion_lookup.sh $HOCKEY_APP_API_TOKEN`
- echo $APP_VERSION
- export DB_CI_RUNNER=true
- export ANDROID_HOME=/sdk-tools/
- export PATH=$PATH:/sdk-tools/platform-tools/
- chmod +x ./gradlew
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@git.coinninja.net/cn/coin-keeper-android-code-signing.git /tmp/secret
- mv /tmp/secret/*.enc app/
- echo "${__google_services_json}" | base64 -d > ./app/google-services.json
- echo "${__key_encryption_key}" | base64 -d > /tmp/secret/key
- echo "${__playstore_service_key}" | base64 -d > ./google_play.json
- openssl enc -d -aes-256-cbc -kfile /tmp/secret/key -in app/keystore.properties.enc -out app/keystore.properties
- openssl enc -d -aes-256-cbc -kfile /tmp/secret/key -in app/coinkeeper-release.jks.enc -out app/coinkeeper-release.jks
- export PREVIOUS_DEPLOY_COMMIT=`sh/gitlab_deploys.sh -t "${API_TOKEN}"`
test-dropbit:
stage: test
tags:
- large
script:
- ./gradlew app:testProductionDebugUnitTest
artifacts:
when: always
expire_in: '8 hours'
paths:
- ./app/build/outputs/apk/production/debug/*.apk
- ./app/build/outputs/apk/staging/debug/*.apk
lint-dropbit:
stage: build
tags:
- android
script:
- ./gradlew app:lintProductionDebug
assemble-dropbit:
stage: build
tags:
- android
script:
- ./gradlew app:assembleDebug
artifacts:
when: always
expire_in: '8 hours'
paths:
- ./app/build/outputs/apk/production/debug/*.apk
- ./app/build/outputs/apk/staging/debug/*.apk
test-common:
stage: test
tags:
- android
script:
- ./gradlew common:lintRelease common:testReleaseUnitTest
artifacts:
when: always
expire_in: '8 hours'
paths:
- ./common/build/outputs/aar/*.aar
test-twitter:
stage: test
tags:
- android
script:
- ./gradlew twitter:lintRelease twitter:testReleaseUnitTest
artifacts:
when: always
expire_in: '8 hours'
paths:
- ./twitter/build/outputs/aar/*.aar
test-persistance:
stage: test
tags:
- android
script:
- ./gradlew persistance:lintRelease persistance:testReleaseUnitTest
artifacts:
when: always
expire_in: '8 hours'
paths:
- ./persistance/build/outputs/aar/*.aar
test-thunderdome:
stage: test
tags:
- android
script:
- ./gradlew thunderdome:lintRelease thunderdome:testReleaseUnitTest
artifacts:
when: always
expire_in: '8 hours'
paths:
- ./thunderdome/build/outputs/aar/*.aar
release-candidate:
stage: deploy
script:
- ./gradlew assembleProduction
environment:
name: internal
tags:
- android
artifacts:
name: "manualInstallableAPK-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA"
when: always
expire_in: '8 hours'
paths:
- ./app/build/outputs/apk/production/**/*.apk
<<: *build_and_sign
only:
- develop@cn/dropbit-android
- /^[\d\.]+RC$/@cn/dropbit-android
production-debug:
stage: deploy
script:
- ./gradlew uploadProductionDebugToHockeyApp
only:
- develop@cn/dropbit-android
- /^[\d\.]+RC$/@cn/dropbit-android
tags:
- android
environment:
name: internal
artifacts:
name: "manualInstallableAPK-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA"
when: always
expire_in: '8 hours'
paths:
- ./app/build/outputs/apk/production/debug/*.apk
staging-debug:
stage: deploy
script:
- ./gradlew uploadStagingDebugToHockeyApp
only:
- develop@cn/dropbit-android
- /^[\d\.]+RC$/@cn/dropbit-android
tags:
- android
environment:
name: internal
artifacts:
name: "manualInstallableAPK-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA"
when: always
expire_in: '8 hours'
paths:
- ./app/build/outputs/apk/production/debug/*.apk
regtest-debug:
stage: deploy
script:
- ./gradlew uploadRegtestDebugToHockeyApp
only:
- develop@cn/dropbit-android
- /^[\d\.]+RC$/@cn/dropbit-android
tags:
- android
environment:
name: internal
artifacts:
name: "manualInstallableAPK-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA"
when: always
expire_in: '8 hours'
paths:
- ./app/build/outputs/apk/production/debug/*.apk