mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
50 lines
1.3 KiB
Bash
Executable File
50 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
. ${SCRIPTS:-/}start-utils
|
|
set -euo pipefail
|
|
isDebugging && set -x
|
|
|
|
IFS=$'\n\t'
|
|
|
|
if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "1.17" ] && [ "${VERSION}" != "PURPUR" ] ; then
|
|
log "ERROR: Airplane server type only supports VERSION=LATEST, VERSION=1.17, VERSION=PURPUR. Note that these are branches, not #.#.# versions."
|
|
exit 1
|
|
fi
|
|
|
|
: ${AIRPLANE_BUILD:=lastSuccessfulBuild}
|
|
: ${AIRPLANE_TYPE:=airplane}
|
|
|
|
if [ "${VERSION}" = "LATEST" ] || [ "${VERSION}" = "1.17" ]; then
|
|
AIRPLANE_BRANCH="1.17"
|
|
fi
|
|
|
|
if [ "${VERSION}" = "PURPUR" ]; then
|
|
AIRPLANE_BRANCH="Purpur-1.17"
|
|
AIRPLANE_TYPE="airplanepurpur"
|
|
fi
|
|
|
|
log "Using Airplane-${AIRPLANE_BRANCH} branch"
|
|
|
|
export SERVER=airplane-${AIRPLANE_BRANCH}-${AIRPLANE_BUILD}.jar
|
|
|
|
log "Removing old Airplane versions ..."
|
|
shopt -s nullglob
|
|
for f in airplane-*.jar; do
|
|
[[ $f != $SERVER ]] && rm $f
|
|
done
|
|
|
|
if [ ! -f "$SERVER" ] || isTrue "${FORCE_REDOWNLOAD:-false}"; then
|
|
downloadUrl="https://ci.tivy.ca/job/Airplane-${AIRPLANE_BRANCH}/${AIRPLANE_BUILD}/artifact/launcher-${AIRPLANE_TYPE}.jar"
|
|
log "Downloading Airplane from $downloadUrl ..."
|
|
if ! get -o "$SERVER" "$downloadUrl"; then
|
|
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
|
exit 3
|
|
fi
|
|
fi
|
|
|
|
# Normalize on Spigot for later operations
|
|
export FAMILY=SPIGOT
|
|
export SKIP_LOG4J_CONFIG=true
|
|
|
|
exec "${SCRIPTS:-/}start-spiget" "$@"
|