mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-11-10 14:24:28 +00:00
41 lines
1.1 KiB
Text
41 lines
1.1 KiB
Text
|
#!/bin/bash
|
||
|
|
||
|
. ${SCRIPTS:-/}start-utils
|
||
|
requireVar VANILLA_VERSION
|
||
|
set -o pipefail
|
||
|
set -e
|
||
|
isDebugging && set -x
|
||
|
|
||
|
mohistJobs=https://ci.codemc.io/job/Mohist-Community/job/
|
||
|
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}"
|
||
|
log " check https://ci.codemc.io/job/Mohist-Community/ for available versions"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
latestBuildRelPath=$(
|
||
|
curl -fsSL "${mohistJob}lastSuccessfulBuild/api/json" |
|
||
|
jq -r '.artifacts[0].relativePath'
|
||
|
)
|
||
|
|
||
|
baseName=$(basename "${latestBuildRelPath}")
|
||
|
if [[ ${baseName} != *-server.jar* ]]; then
|
||
|
log "ERROR: mohist build for ${VANILLA_VERSION} is not a valid server jar, found ${baseName}"
|
||
|
log " check https://ci.codemc.io/job/Mohist-Community/ for available versions"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
export SERVER="/data/${baseName}"
|
||
|
|
||
|
if [ ! -f ${SERVER} ]; then
|
||
|
log "Downloading ${SERVER}"
|
||
|
curl -o "${SERVER}" -fsSL "${mohistJob}lastSuccessfulBuild/artifact/${latestBuildRelPath}"
|
||
|
fi
|
||
|
|
||
|
export SKIP_LOG4J_CONFIG=true
|
||
|
|
||
|
# Continue to Final Setup
|
||
|
exec ${SCRIPTS:-/}start-finalSetup01World $@
|