-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.gitlab-ci.yml
78 lines (67 loc) · 1.97 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
image: code.lab10.io:4567/graz/10-minerva/minerva-android-v2:builder-v3
before_script:
- cp ./gradle/wrapper/gradle-wrapper.properties.ci ./gradle/wrapper/gradle-wrapper.properties
- cp /usr/src/builder/local.properties . >/dev/null 2>&1 || true
stages:
- validation
- distribution
- update-variable
- deploy
validateBranch:
stage: validation
except:
refs:
- master
- production
script:
- echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > MinervaApp/google-services.json
- java -version
- ./gradlew test
validateLint:
stage: validation
except:
refs:
- master
- production
script:
- echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > MinervaApp/google-services.json
- java -version
- ./gradlew lint
distributeStagingBuild:
stage: distribution
only:
refs:
- master
script:
- echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > MinervaApp/google-services.json
- base64 -d $KEY_STORE_FILE > MinervaApp/keyStoreMinerva.jks
- ./gradlew build
- . /etc/profile.d/rvm.sh
- fastlane firebaseStaging
artifacts:
paths:
- ./MinervaApp/build/outputs/apk/staging
updateProjectVariable:
stage: update-variable
image: curlimages/curl:latest
only:
refs:
- master
script:
- |
curl --silent --show-error --request PUT --header "PRIVATE-TOKEN: $API_TOKEN" "https://code.lab10.io/api/v4/projects/166/variables/VERSION_CODE_STAGING" --form "value=$(($VERSION_CODE_STAGING + 1))"
alphaGooglePlayStore:
stage: deploy
only:
refs:
- production
script:
- echo "$GOOGLE_SERVICES_JSON_BASE64" | base64 --decode > MinervaApp/google-services.json
- base64 -d $KEY_STORE_FILE > MinervaApp/keyStoreMinerva.jks
- ./gradlew build
- . /etc/profile.d/rvm.sh
- echo $PLAY_JSON > ./json_file.json
- fastlane productionAlphaRelease json_path:./json_file.json
artifacts:
paths:
- ./MinervaApp/build/outputs/apk/production