docker-minecraft-server/start-deployMohist

45 lines
1.2 KiB
Text
Raw Normal View History

2020-06-19 16:31:56 +00:00
#!/bin/bash
. ${SCRIPTS:-/}start-utils
set -o pipefail
set -e
isDebugging && set -x
requireVar VANILLA_VERSION
2021-02-28 02:37:59 +00:00
: ${MOHIST_BUILD:=lastSuccessfulBuild}
2021-05-22 03:05:22 +00:00
mohistJobs=https://ci.codemc.io/job/MohistMC/job/
2020-06-19 16:31:56 +00:00
mohistJob=${mohistJobs}Mohist-${VANILLA_VERSION}/
if ! curl -X HEAD -o /dev/null -fsSL "${mohistJob}"; then
log "ERROR: mohist builds do not exist for ${VANILLA_VERSION}"
2021-05-22 03:05:22 +00:00
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
log " and set VERSION accordingly"
2020-06-19 16:31:56 +00:00
exit 1
fi
2021-02-28 02:37:59 +00:00
buildRelPath=$(
curl -fsSL "${mohistJob}${MOHIST_BUILD}/api/json" |
2020-06-19 16:31:56 +00:00
jq -r '.artifacts[0].relativePath'
)
2021-02-28 02:37:59 +00:00
baseName=$(basename "${buildRelPath}")
2020-06-19 16:31:56 +00:00
if [[ ${baseName} != *-server.jar* ]]; then
log "ERROR: mohist build for ${VANILLA_VERSION} is not a valid server jar, found ${baseName}"
2021-05-22 03:05:22 +00:00
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
log " and set VERSION accordingly"
2020-06-19 16:31:56 +00:00
exit 1
fi
export SERVER="/data/${baseName}"
if [ ! -f ${SERVER} ]; then
2020-06-20 20:28:21 +00:00
log "Downloading ${baseName}"
2021-02-28 02:37:59 +00:00
curl -o "${SERVER}" -fsSL "${mohistJob}${MOHIST_BUILD}/artifact/${buildRelPath}"
2020-06-19 16:31:56 +00:00
fi
export SKIP_LOG4J_CONFIG=true
# Continue to Final Setup
exec ${SCRIPTS:-/}start-finalSetupWorld "$@"