forked from nilskre/CommonPlayground
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
121 lines (116 loc) · 4.18 KB
/
.travis.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
dist: trusty
stages:
- build-backend
- build-frontend
- test-backend
- test-frontend
- deploy-backend
- deploy-frontend
- send-coverage
env:
global:
- ANDROID_API_LEVEL=28
- ANDROID_BUILD_TOOLS_VERSION=28.0.3
- ANDROID_API_LEVEL_UI_TESTS=21
- ANDROID_BUILD_TOOLS_VERSION_UI_TESTS=21.0.3
jobs:
include:
- stage: build-backend
language: java
script:
- "(cd backend/; ./gradlew assemble)"
- stage: build-frontend
language: android
android:
components:
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
- android-$ANDROID_API_LEVEL
script:
- "(cd frontend/; ./gradlew assembleDebug)"
- stage: test-backend
language: java
script:
- cd backend/
- "./gradlew test clean"
- stage: test-frontend
language: android
android:
components:
- build-tools-$ANDROID_BUILD_TOOLS_VERSION_UI_TESTS
- android-$ANDROID_API_LEVEL_UI_TESTS
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
- android-$ANDROID_API_LEVEL
- add-on
- extra
- sys-img-armeabi-v7a-android-$ANDROID_API_LEVEL_UI_TESTS
before_script:
- cd frontend/
- android list targets
- echo no | android create avd --force -n test -t android-$ANDROID_API_LEVEL_UI_TESTS
--abi default/armeabi-v7a
- emulator -avd test -no-window &
- android-wait-for-emulator
- adb shell settings put global window_animation_scale 0 &
- adb shell settings put global transition_animation_scale 0 &
- adb shell settings put global animator_duration_scale 0 &
- adb shell input keyevent 82 &
script:
- "./gradlew test"
- "./gradlew clean connectedCheck"
- stage: deploy-backend
if: branch = master
language: java
services:
- docker
provider: heroku
script:
- cd backend/
- "./gradlew build docker"
- docker login -u $DOCKER_USERNAME -p $DOCKER_PW
- docker push commonplayground/commonplayground
- docker logout
- heroku container:login
- docker tag commonplayground/commonplayground:latest registry.heroku.com/commonplayground/web
- docker push registry.heroku.com/commonplayground/web
- heroku container:release web -a commonplayground
- stage: deploy-frontend
if: branch = master
language: android
android:
components:
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
- android-$ANDROID_API_LEVEL
script:
- cd frontend/
- openssl aes-256-cbc -K $encrypted_ba187bd0e4a1_key -iv $encrypted_ba187bd0e4a1_iv
-in ../keystore.jks.enc -out keystore.jks -d
- "./gradlew assembleRelease"
before_deploy:
- echo "Start Frontend Deployment"
- export APP_VERSION_RAW=$(./gradlew :app:printVersionName --warning-mode=none)
- export APP_VERSION="$(echo $APP_VERSION_RAW | sed 's/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/')"
- echo $APP_VERSION
- export LATEST_GIT_COMMIT_HASH="$(git rev-parse HEAD)"
- echo $LATEST_GIT_COMMIT_HASH
- export APP_VERSION_GIT_HASH="$APP_VERSION-$LATEST_GIT_COMMIT_HASH"
- echo $APP_VERSION_GIT_HASH
deploy:
provider: releases
api_key:
secure: BRN+/GjSJvwH3rn3MK8harchvtW57Qi/+bJANjP+1Qg+qS0xnxmFDYtUUU1nU3O2yXBsdJLbyIsx9MrID01L0YBT8kYw5JfuayyVlaQzqa+ibZ2WLGMcmS/sKHoGtBXCnG9/wWfqa+hXvxUBTPxo9JRU8P2dIpT49yPcJC+V7ZDMj2YiCe7odbwI/ixjUVIfsk59RcnvbhdyTSd2w0vbGwHyd4Yb6W4Hh1ICWIivWhaafp4lwPa4xObeKUyTOWP7cxEMUIwatQbEK3eX91QcrQiloMPrNem1zoL3q62KeoJMmcixSp7fixtxAY461u/ezVlAsc7tVVW79ytoGCq17fMQJf9jHDeWd8RBIEhaq2uhmI/Evy6cKYYFJyzjk5U1lyxHe05vWRF6F9ZQQvl3v8pmBkJtfVik5/AWDmUayk80VUW5K/VyUEmeMdU8R5d+rGIlju9r787SsE+rgcKYbgjSARMx39N22umEg1z7QZMsBFyoKaYtPZrLCviwExF5Bj5S+RqbjMCmMqyrnOx5vumtzKld3LYAcKDJM4SyLmqa8+KDZ4FuwCH7uv+22tSr2vypoGeE+Zug5trhrAURyHVRAnLswntQ3SDVlX4Yxf6uuGAh0ZSTJrBvKjWRkxOwf4yRq2q/Zj8qxRpRjn1qU/zPWv3TCDcn2BAzMe1KpCU=
file: app/build/outputs/apk/release/app-release.apk
file_glob: true
skip_cleanup: true
overwrite: true
name: "$APP_VERSION_GIT_HASH"
tag_name: "$APP_VERSION_GIT_HASH"
on:
repo: nilskre/CommonPlayground
branch: master
- stage: send-coverage
language: java
script:
- cd backend/
- "./gradlew build"
- "./gradlew jacocoTestReport"
- "./gradlew sendCoverageToCodacy"