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
·65 lines (56 loc) · 1.4 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
59
60
61
62
63
64
65
#!/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"
;;
'unminified')
RELEASE_SUFFIX="unminified_"
NODE_ENV="development"
RFLAG="--release"
RELEASE_OUTPUT_DIR="release"
;;
'foss')
RELEASE_SUFFIX="foss_"
NODE_ENV="production"
RFLAG="--release"
RELEASE_OUTPUT_DIR="release"
;;
'debug')
RELEASE_SUFFIX=""
NODE_ENV="development"
RFLAG="--debug"
RELEASE_OUTPUT_DIR="debug"
;;
*)
echo error: release may only be production, unminified, foss, or debug >&2
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}" == 'foss' ]
then
npx cordova plugin rm cordova-plugin-chromecast
fi
# Build APK
npx cordova build android "${RFLAG}"
# Move the artifacts out
mkdir -p "${ARTIFACT_DIR}/apk"
mmv "${SOURCE_DIR}/platforms/android/app/build/outputs/apk/*/jellyfin-android_*.apk" "${ARTIFACT_DIR}/apk/"