Adjusted VERSION handling to allow specific versions

Fixes #79
This commit is contained in:
Geoff Bourne committed 2020-07-02 17:17:52 -05:00
1 parent b8be36016e
commit 24c7a2ca7d
2 files changed
+14 -6

No files matched your search

+1
View File
@@ -32,6 +32,7 @@ For Minecraft Java Edition you'll need to use this image instead:
- `1.13` : the latest version of 1.13 - `1.13` : the latest version of 1.13
- `1.14` : the latest version of 1.14 - `1.14` : the latest version of 1.14
- `1.16` : the latest version of 1.16 - `1.16` : the latest version of 1.16
- otherwise any specific server version can be provided to allow for temporary bug avoidance, etc
- `UID` (default derived from `/data` owner) : can be set to a specific user ID to run the - `UID` (default derived from `/data` owner) : can be set to a specific user ID to run the
bedrock server process bedrock server process
- `GID` (default derived from `/data` owner) : can be set to a specific group ID to run the - `GID` (default derived from `/data` owner) : can be set to a specific group ID to run the
+13 -6
View File
@@ -14,23 +14,23 @@ fi
set -e set -e
case ${VERSION} in case ${VERSION^^} in
1.11) 1.11)
VERSION=1.11.4.2 VERSION=1.11.4.2
;; ;;
1.12) 1.12)
VERSION=1.12.0.28 VERSION=1.12.0.28
;; ;;
1.13|PREVIOUS) 1.13)
VERSION=1.13.0.34 VERSION=1.13.0.34
;; ;;
1.14) 1.14|PREVIOUS)
VERSION=1.14.60.5 VERSION=1.14.60.5
;; ;;
1.16) 1.16)
VERSION=1.16.0.2 VERSION=1.16.1.02
;; ;;
*) LATEST)
for a in data-bi-prtid data-platform; do for a in data-bi-prtid data-platform; do
DOWNLOAD_URL=$(restify --attribute=${a}=serverBedrockLinux ${downloadPage} 2> /tmp/restify.out | jq -r '.[0].href' || echo '') DOWNLOAD_URL=$(restify --attribute=${a}=serverBedrockLinux ${downloadPage} 2> /tmp/restify.out | jq -r '.[0].href' || echo '')
if [[ ${DOWNLOAD_URL} ]]; then if [[ ${DOWNLOAD_URL} ]]; then
@@ -45,6 +45,9 @@ case ${VERSION} in
exit 2 exit 2
fi fi
;; ;;
*)
# use the given version exactly
;;
esac esac
if [ ! -f "bedrock_server-${VERSION}" ]; then if [ ! -f "bedrock_server-${VERSION}" ]; then
@@ -56,7 +59,11 @@ if [ ! -f "bedrock_server-${VERSION}" ]; then
TMP_ZIP=/tmp/$(basename "${DOWNLOAD_URL}") TMP_ZIP=/tmp/$(basename "${DOWNLOAD_URL}")
echo "Downloading Bedrock server version ${VERSION} ..." echo "Downloading Bedrock server version ${VERSION} ..."
curl -o ${TMP_ZIP} -fsSL ${DOWNLOAD_URL} if ! curl -o ${TMP_ZIP} -fsSL ${DOWNLOAD_URL}; then
echo "ERROR failed to download from ${DOWNLOAD_URL}"
echo " Double check that the given VERSION is valid"
exit 2
fi
# remove only binaries and some docs, to allow for an upgrade of those # remove only binaries and some docs, to allow for an upgrade of those
rm -rf bedrock_server *.so release-notes.txt bedrock_server_how_to.html valid_known_packs.json premium_cache 2> /dev/null rm -rf bedrock_server *.so release-notes.txt bedrock_server_how_to.html valid_known_packs.json premium_cache 2> /dev/null