docker-minecraft-server/scripts/start-deployPurpur

43 lines
913 B
Text
Raw Normal View History

2021-02-07 17:22:08 +00:00
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
2023-06-14 02:35:09 +00:00
: "${PURPUR_BUILD:=LATEST}"
: "${PURPUR_DOWNLOAD_URL:=}"
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
2021-02-07 17:22:08 +00:00
isDebugging && set -x
2023-06-14 02:35:09 +00:00
resultsFile=/data/.purpur.env
2023-06-14 02:35:09 +00:00
if [[ $PURPUR_DOWNLOAD_URL ]]; then
if ! mc-image-helper install-purpur \
--output-directory=/data \
--results-file="$resultsFile" \
--url="${PURPUR_DOWNLOAD_URL}"; then
logError "Failed to download from custom Purpur URL"
2023-06-14 02:35:09 +00:00
exit 1
2021-02-07 17:22:08 +00:00
fi
else
2023-06-14 02:35:09 +00:00
args=(
--output-directory=/data
--results-file="$resultsFile"
--version="$VERSION"
)
if [[ $PURPUR_BUILD ]]; then
args+=(--build="$PURPUR_BUILD")
fi
2023-06-14 02:35:09 +00:00
if ! mc-image-helper install-purpur "${args[@]}"; then
logError "Failed to download Purpur"
2023-06-14 02:35:09 +00:00
exit 1
fi
2021-02-07 17:22:08 +00:00
fi
applyResultsFile ${resultsFile}
2021-02-07 17:22:08 +00:00
# Normalize on Spigot for later operations
export FAMILY=SPIGOT
2021-02-07 17:22:08 +00:00
exec "${SCRIPTS:-/}start-spiget" "$@"