-
Notifications
You must be signed in to change notification settings - Fork 41
/
gitlab-ci.yml
126 lines (106 loc) · 3.51 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
# cookie cutter git lab development pipeline
# TODO - create an image that is the openjdk image + the SDK and NDK setup to
# make initialization faster shb 10/19/2019
image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "21"
ANDROID_BUILD_TOOLS: "29.0.2"
ANDROID_SDK_TOOLS: "4333796"
NDK_VERSION: "12b"
WGET: "wget --quiet --tries=0"
GIT_STRATEGY: clone
GIT_TOKEN: "3ydao3HGquPdh2ybxKQk"
cache:
key: android_sdk21_buildtools_29.0.2_ndk_12b
paths:
- android-sdk-linux
- android-ndk-r12b
before_script:
- curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
- apt-get install git-lfs
#- stage the sdk
- git clone --depth 1 https://civsdk_builder:[email protected]/sdks/atak-civ.git
# TODO - investigate why lfs pull is failing with
# git lfs pull cannot add to the index - missing --add option? fixed
# when using git clone -n
#- pushd .
#- cd atak-civ
#- GIT_TRACE=1 git lfs pull -I "*main.jar"
#- popd
- if [ ! -d android-sdk-linux ]; then
$WGET --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip;
unzip -qq -d android-sdk-linux android-sdk.zip;
else
echo "using cached version of the the android sdk";
fi
- mkdir -p ~/.android;
- touch ~/.android/repositories.cfg;
- echo y | android-sdk-linux/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null;
- echo y | android-sdk-linux/tools/bin/sdkmanager "platform-tools" >/dev/null;
- echo y | android-sdk-linux/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null;
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
# install the NDK build so we can actually strip the libraries
- if [ ! -d android-ndk-r12b ]; then
$WGET --output-document=android-ndk.zip https://dl.google.com/android/repository/android-ndk-r${NDK_VERSION}-linux-x86_64.zip;
unzip -qq android-ndk.zip;
else
echo "using cached version of the the android ndk";
fi
# temporarily disable checking for EPIPE error and use yes to accept all licenses
- set +o pipefail
- yes | android-sdk-linux/tools/bin/sdkmanager --licenses
- set -o pipefail
- export ANDROID_NDK_HOME=$PWD/android-ndk-r${NDK_VERSION}
- chmod +x ./gradlew
- git branch
- java -version
- ./gradlew --version
stages:
- build
- test
assembleMilRelease:
stage: build
script:
- pwd .
- mkdir sdk
- cp atak-civ/main.jar sdk
- cp atak-civ/android_keystore sdk
- find . -name main.jar
- ./gradlew -Pci --console=plain lintMilRelease assembleMilRelease
artifacts:
expire_in: 720h
paths:
- app/build/outputs/
assembleCivRelease:
stage: build
script:
- mkdir sdk
- cp atak-civ/main.jar sdk
- cp atak-civ/android_keystore sdk
- ./gradlew -Pci --console=plain lintCivRelease assembleCivRelease
artifacts:
expire_in: 720h
paths:
- app/build/outputs/
when: manual
assembleFveyRelease:
stage: build
script:
- mkdir sdk
- cp atak-civ/main.jar sdk
- cp atak-civ/android_keystore sdk
- ./gradlew -Pci --console=plain lintFveyRelease assembleFveyRelease
artifacts:
expire_in: 720h
paths:
- app/build/outputs/
when: manual
testRelease:
stage: test
script:
- mkdir sdk
- cp atak-civ/main.jar sdk
- cp atak-civ/android_keystore sdk
- cp -R atak-civ/espresso .
- ./gradlew -Pci --console=plain testMilRelease