forked from SSAFY-D211-DRTAA/DRTAA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
65 lines (61 loc) ยท 2.55 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
image: eclipse-temurin:17-jdk-jammy
variables:
ANDROID_COMPILE_SDK: "34"
ANDROID_BUILD_TOOLS: "34.0.0"
ANDROID_SDK_TOOLS: "9477386"
before_script:
- cd Drtaa-Android
- apt-get --quiet update --yes
- apt-get --quiet install --yes wget unzip
- export ANDROID_HOME="${PWD}/android-sdk-root"
- install -d $ANDROID_HOME
- wget --no-verbose --output-document=$ANDROID_HOME/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS}_latest.zip
- unzip -q -d "$ANDROID_HOME/cmdline-tools" "$ANDROID_HOME/cmdline-tools.zip"
- mv -T "$ANDROID_HOME/cmdline-tools/cmdline-tools" "$ANDROID_HOME/cmdline-tools/tools"
- export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/cmdline-tools/tools/bin
- sdkmanager --version
- yes | sdkmanager --licenses > /dev/null || true
- sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}"
- sdkmanager "platform-tools"
- sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}"
- chmod +x ./gradlew
- echo "$GOOGLE_SERVICES" | base64 -d > app/google-services.json
- echo "sdk.dir=$ANDROID_SDK_ROOT" > local.properties
- echo "NAVER_MAP_CLIENT_ID=\"$NAVER_MAP_CLIENT_ID\"" >> local.properties
- echo "NAVER_MAP_CLIENT_ID_MANIFEST=$NAVER_MAP_CLIENT_ID_MANIFEST" >> local.properties
- echo "NAVER_MAP_CLIENT_SECRET=\"$NAVER_MAP_CLIENT_SECRET\"" >> local.properties
- echo "NAVER_CLIENT_ID=\"$NAVER_CLIENT_ID\"" >> local.properties
- echo "NAVER_CLIENT_SECRET=\"$NAVER_CLIENT_SECRET\"" >> local.properties
- echo "GOOGLE_LOGIN_CLIENT_ID=\"$GOOGLE_LOGIN_CLIENT_ID\"" >> local.properties
- echo "TOUR_API_KEY=\"$TOUR_API_KEY\"" >> local.properties
- echo "BASE_URL=\"$BASE_URL\"" >> local.properties
- echo "MQTT_URL=\"$MQTT_URL\"" >> local.properties
- echo "BOOTPAY_APP_ID=\"$BOOTPAY_APP_ID\"" >> local.properties
- echo "APP_KEY=\"$APP_KEY\"" >> local.properties
detektAnalysis:
stage: test
script:
- ./gradlew detekt
artifacts:
paths:
- Drtaa-Android/build/reports/detekt/
expire_in: 8h
allow_failure: false
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_COMMIT_REF_NAME =~ /.*android.*/
changes:
- Drtaa-Android/**/*
assembleDebug:
interruptible: true
stage: build
script:
- ./gradlew assembleDebug
artifacts:
paths:
- Drtaa-Android/app/build/outputs/apk/debug/app-debug.apk
- Drtaa-Android/app/build/outputs/logs/
expire_in: 8h
rules:
- if: $CI_COMMIT_BRANCH == "develop" && $CI_PIPELINE_SOURCE != "merge_request_event"
changes:
- Drtaa-Android/**/*