docker-minecraft-server/scripts/start-deployPurpur

52 lines
1.1 KiB
Plaintext
Raw Permalink 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
log "ERROR: failed to download from custom Purpur URL"
exit 1
2021-02-07 17:22:08 +00:00
fi
2023-06-14 02:35:09 +00:00
# grab SERVER and export it
set -a
# shellcheck disable=SC1090
source "${resultsFile}"
set +a
2021-02-07 17:22:08 +00:00
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
log "ERROR: failed to download Purpur"
exit 1
fi
2023-06-14 02:35:09 +00:00
# grab SERVER and export it
set -a
# shellcheck disable=SC1090
source "${resultsFile}"
set +a
2021-02-07 17:22:08 +00:00
fi
# Normalize on Spigot for later operations
export FAMILY=SPIGOT
2021-02-07 17:22:08 +00:00
exec "${SCRIPTS:-/}start-spiget" "$@"