2021-04-08 23:50:06 +00:00
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
. ${SCRIPTS:-/}start-utils
isDebugging && set -x
2021-07-13 00:03:17 +00:00
if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "1.16" ] && [ "${VERSION}" != "1.17" ] && [ "${VERSION}" != "PURPUR" ] && [ "${VERSION}" != "PURPUR-1.16" ] ; then
log "ERROR: Airplane server type only supports VERSION=LATEST, VERSION=1.17, VERSION=1.16, VERSION=PURPUR or VERSION=PURPUR-1.16. Note that these are branches, not #.#.# versions."
2021-06-24 03:29:58 +00:00
exit 1
fi
: ${AIRPLANE_BUILD:=lastSuccessfulBuild}
2021-04-08 23:50:06 +00:00
2021-07-13 00:03:17 +00:00
if [ "${VERSION}" = "LATEST" ] || [ "${VERSION}" = "1.17" ]; then
2021-06-24 03:29:58 +00:00
AIRPLANE_BRANCH="1.17"
fi
2021-07-13 00:03:17 +00:00
if [ "${VERSION}" = "1.16" ]; then
AIRPLANE_BRANCH="1.16"
2021-07-08 22:56:06 +00:00
fi
2021-06-24 03:29:58 +00:00
if [ "${VERSION}" = "PURPUR" ]; then
2021-07-13 00:03:17 +00:00
AIRPLANE_BRANCH="Purpur-1.17"
fi
if [ "${VERSION}" = "PURPUR-1.16" ]; then
2021-06-24 12:46:40 +00:00
AIRPLANE_BRANCH="Purpur-1.16"
2021-04-08 23:50:06 +00:00
fi
2021-06-24 12:46:40 +00:00
log "Using Airplane-${AIRPLANE_BRANCH} branch"
2021-06-24 03:29:58 +00:00
export SERVER=airplane-${AIRPLANE_BRANCH}-${AIRPLANE_BUILD}.jar
2021-04-08 23:50:06 +00:00
2021-04-09 17:25:51 +00:00
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
2021-06-24 03:29:58 +00:00
downloadUrl="https://ci.tivy.ca/job/Airplane-${AIRPLANE_BRANCH}/${AIRPLANE_BUILD}/artifact/launcher-airplane.jar"
2021-04-08 23:50:06 +00:00
log "Downloading Airplane from $downloadUrl ..."
curl -fsSL -o "$SERVER" "$downloadUrl"
if [ ! -f "$SERVER" ]; then
log "ERROR: failed to download from $downloadUrl (status=$?)"
exit 3
fi
fi
# Normalize on Spigot for later operations
export TYPE=SPIGOT
export SKIP_LOG4J_CONFIG=true
2021-04-13 01:21:53 +00:00
exec ${SCRIPTS:-/}start-spiget "$@"