docker-minecraft-server/scripts/start-deployMohist

44 lines
1.1 KiB
Text
Raw Normal View History

2020-06-19 16:31:56 +00:00
#!/bin/bash
# shellcheck source=start-utils
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
2020-06-19 16:31:56 +00:00
set -o pipefail
set -e
isDebugging && set -x
resolveVersion
: "${MOHIST_BUILD:=lastSuccessfulBuild}"
2021-05-22 03:05:22 +00:00
mohistJobs=https://ci.codemc.io/job/MohistMC/job/
mohistJob=${mohistJobs}Mohist-${VERSION}/
2020-06-19 16:31:56 +00:00
if ! get --exists "${mohistJob}"; then
log "ERROR: mohist builds do not exist for ${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=$(
get --json-path '$.artifacts[0].relativePath' "${mohistJob}${MOHIST_BUILD}/api/json"
2020-06-19 16:31:56 +00:00
)
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 ${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}"
get -o "${SERVER}" "${mohistJob}${MOHIST_BUILD}/artifact/${buildRelPath}"
2020-06-19 16:31:56 +00:00
fi
export FAMILY=HYBRID
exec "${SCRIPTS:-/}start-spiget" "$@"