forked from jellyfin-archive/jellyfin-android-original
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-build.sh
executable file
·58 lines (49 loc) · 1.21 KB
/
docker-build.sh
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
#!/bin/bash
# Builds the APK inside the Docker container
set -o errexit
set -o xtrace
# Handle the release type
RELEASE="${RELEASE:-debug}"
case "${RELEASE}" in
'production')
RELEASE_SUFFIX=""
NODE_ENV="production"
RFLAG="--release"
RELEASE_OUTPUT_DIR="release"
;;
'libre')
RELEASE_SUFFIX="libre_"
NODE_ENV="production"
RFLAG="--release"
RELEASE_OUTPUT_DIR="release"
;;
'debug')
RELEASE_SUFFIX=""
NODE_ENV="development"
RFLAG="--debug"
RELEASE_OUTPUT_DIR="debug"
;;
*)
echo "error: release type must be production, libre, or debug"
exit 1
esac
# Export environment variables
export ANDROID_HOME="${ANDROID_DIR}"
export NODE_ENV
# Move to source directory
pushd "${SOURCE_DIR}"
# Install dependencies
npm cache verify
npm config set unsafe-perm true
npm ci
npx gulp
npx cordova telemetry off
npx cordova prepare
if [ "${RELEASE}" == 'libre' ]
then
npx cordova plugin rm cordova-plugin-chromecast
fi
# Build APK
npx cordova build android "${RFLAG}"
# Move the artifacts
mmv "${SOURCE_DIR}/platforms/android/app/build/outputs/apk/*/jellyfin-android_*.apk" "${ARTIFACT_DIR}"