-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
282 lines (265 loc) · 8.91 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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
---
stages:
- prebuild
- check
- test
- build
## Temporarily move upload step before tests
- upload
- devicefarm-test
- devicefarm-test-top
- devicefarm-test-next
- devicefarm-test-final
- devicefarm-test-upgrade-path
- devicefarm-test-acapy
### - Pre-build - ###
# Helpers / Anchors
.kaniko_build:
tags:
- docker-machine
- large
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- if [ "$CI_COMMIT_REF_SLUG" == 'main' ]; then KANIKO_ARGS="--destination $CI_REGISTRY_IMAGE/${DOCKER_IMAGE_NAME}:latest $KANIKO_ARGS"; fi
- echo "${KANIKO_ARGS}"
- |
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}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MBaA
FOrH4oUpB94gNDNqdGG92kdVZ3qkMA0GCSqGSIb3DQEBCwUAA4ICAQCwjN3ggZ98
BXT39fKkCX3FHb0++aFcIyMKWrcZIpYrl3GoZsNKZK4QNQ+uJOP8xmqgyrCoMfch
VIGPQ0RDN/IzqCLhc/U3pDmk2hXa3xTxD3gpCQZ6Bz04KlcLfZd5jzbI741bVDyF
a1n46bEyuqV4SsNJWI/FGokJCNcZH66njBQBaQAccZ7xB9vWU9yjIYtGQDDvSm6J
SC2knrQri0vv4QLUSc1LS6AlWWSQxcCpcdO+OzIFGsf5bVmYN6J4R3COY5NyQ+yn
pOSN2NOh5h3ZrYAxm3i4Il0orVLveVcTVDGeAgZUII4YLJi/01RHGqit3aCuApSh
bzFTZ5FldFss+JX9iAhqpFDbHLgae0F3QmYEnGilt/PzO4j23QJo3FZKeruQLH7P
L9aOgN6S2+Akbbm9YTc59yzU5TZMxANwTdaYFWFqk/8nKgZiBR1l8jnWTlWnm86A
qVssH3DLKwiYrWSOHRzGuN5BmPXxxtKQJlwAXt0wJE3puUkaJSRo7CJQ3QNMoKDe
OjzXc9WvkFIXr3Eui8UTiHB/WT7N4o8hmVN404akGfWE0YNwRVfWpjGdew6g0tZi
lFnjUUk49av67um43JHcinT5NFPuleZzkjaL/D8ueOrjXQDy05rwVdgmw9pXog4B
Tw6APXtEnjfD2H8HOpOX/7ef4gWK0O1Q7A==
-----END CERTIFICATE-----" >> /kaniko/ssl/certs/ca-certificates.crt
- |
/kaniko/executor ${KANIKO_ARGS} --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/${DOCKERFILE_PATH} \
--destination $CI_REGISTRY_IMAGE/${DOCKER_IMAGE_NAME}:${CI_COMMIT_REF_SLUG}
# Jobs
## Build image for Appium tests ##
devicefarm-buildtools:
stage: prebuild
extends: .kaniko_build
variables:
DOCKERFILE_PATH: ci/images/devicefarm.dockerfile
DOCKER_IMAGE_NAME: devicefarm
only:
changes:
- ci/images/devicefarm.dockerfile
ubuntu-build:
stage: prebuild
extends: .kaniko_build
tags:
- docker-machine
variables:
DOCKERFILE_PATH: ci/images/ubuntu18.dockerfile
DOCKER_IMAGE_NAME: ubuntu18
only:
changes:
- ci/images/ubuntu18.dockerfile
### - Checks - ###
## - Check license file - ##
#license-data-check:
# stage: check
# image: ${CI_REGISTRY_IMAGE}/ubuntu18:${CI_COMMIT_REF_SLUG}
# script: ./ci/license-date-check.sh
# only:
# refs:
# - branches
# - tags
# tags:
# - docker-machine
# except:
# - white-label-app-e2e-testing
### - Test - ###
### - iOS - ###
.build-ios:
stage: build
tags:
- macos
- monterey
- xcode-13-3
artifacts:
paths:
- ios/ConnectMe.ipa
- ios/ConnectMe-appstore.ipa
script:
- xcversion select --verbose --symlink 13.3
- xcversion selected
- sudo xcodebuild -license accept
- cd ios
- gem uninstall bundler
- gem install bundler
- bundler update --bundler
- cd ..
- mkdir -p ~/.ssh/
- ssh-keyscan -4H gitlab.corp.evernym.com > ~/.ssh/known_hosts
- eval $(ssh-agent -s)
- echo "$CALLCENTER_CERTS_DEPLOY_KEY" | tr -d '\r' | ssh-add - > /dev/null
- echo "$IOSDEV_EVERNYM_RSA_KEY" | tr -d '\r' | ssh-add - > /dev/null
- chmod 644 ~/.ssh/known_hosts
- nvm use
- yarn install
- security -v unlock-keychain -p ${VAGRANT_USER_PASS} ~/Library/Keychains/login.keychain-db
- git config --global user.name 'Gitlab'
- git config --global user.email '[email protected]'
- git remote set-url origin [email protected]:${CI_PROJECT_PATH}.git
- cd ios
- bundle install
- export LC_ALL=en_US.UTF-8
- export LANG=en_US.UTF-8
- bundle exec fastlane build
after_script:
- cat ./ios/react-native-xcode.sh.log
build-ios-merge-request:
extends: .build-ios
variables:
BUILD_TYPE: 'ConnectMe Dev Build'
DEVELOPER_DIR: '/Applications/Xcode.app/Contents/Developer/'
# rules:
# - if: '$CI_COMMIT_REF_NAME == "white-label-app-e2e-testing"'
# when: always
# # run this for any branch except main
only:
refs:
- branches
variables:
- $CI_COMMIT_REF_PROTECTED == "true"
except:
- main@evernym/mobile/connectme
build-ios-master:
extends: .build-ios
# Variable expansion doesn't work in `variables` section. Do it here instead.
variables:
BUILD_TYPE: 'QA ConnectMe Build'
DEVELOPER_DIR: '/Applications/Xcode.app/Contents/Developer/'
# this gets passed to the anchor
only:
refs:
- main@evernym/mobile/connectme
### - Android - ###
.build-android:
stage: build
tags:
- docker-machine
- large
image: bitriseio/android-ndk-lts
artifacts:
paths:
- android/app/build/outputs/apk/release/*.apk
expire_in: 1 week
script:
- chmod +x ./ci/install-nodejs.sh
- ./ci/install-nodejs.sh
- yarn
- mkdir -p $HOME/keystores/
- yes | sdkmanager --licenses || true
- cd android
- gem install bundler:2.3.22
- bundle install
- echo ${ANDROID_KEYSTORE_B64} | base64 -d > $HOME/keystores/my_keystore.jks
- update-alternatives --set javac /usr/lib/jvm/java-11-openjdk-amd64/bin/javac
- update-alternatives --set java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
- export JAVA_HOME='/usr/lib/jvm/java-11-openjdk-amd64'
- java -version
- bundle exec fastlane build
build-android-merge-request:
extends: .build-android
artifacts:
paths:
- android/app/build/outputs/apk/release/*.apk
expire_in: 1 week
# rules:
# - if: '$CI_COMMIT_REF_NAME == "white-label-app-e2e-testing"'
# when: always
# # run this for any branch except main
only:
refs:
- branches
variables:
- $CI_COMMIT_REF_PROTECTED == "true"
except:
- main@evernym/mobile/connectme
build-android-master:
extends: .build-android
only:
refs:
- main@evernym/mobile/connectme
# Upload jobs
upload-ios:
stage: upload
tags:
- macos
- monterey
- xcode-13-3
script:
- xcversion select --verbose --symlink 13.3
- xcversion selected
- sudo xcodebuild -license accept
- cd ios
- gem install fastlane
- bundle install
- bundle exec fastlane upload
only:
refs:
- main@evernym/mobile/connectme
upload-android:
stage: upload
script:
- cd android
- gem install bundler:2.3.22
- bundle install
- bundle exec fastlane upload
only:
refs:
- main@evernym/mobile/connectme
# Basic lint
#yarn-test:
# stage: test
# image: ${CI_REGISTRY_IMAGE}/ubuntu18:${CI_COMMIT_REF_SLUG}
# script:
# - dig @8.8.8.8 google.com
# - dig google.com
# - dig www.npmjs.com
# - dig https://jcenter.bintray.com
# - dig @8.8.8.8 https://jcenter.bintray.com
# - yarn config set ignore-engines true
# - yarn install
# - yarn lint
# only:
# refs:
# - branches
# - tags
# tags:
# - docker-machine
# except:
# - white-label-app-e2e-testing
### - Devicefarm-test - ###
include:
local: "/ci/devicefarm-test.yml"