diff --git a/Dockerfile b/Dockerfile index cf40df61..bec7b35c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -60,7 +60,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ --var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \ --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz -ARG MC_HELPER_VERSION=1.8.1 +ARG MC_HELPER_VERSION=1.9.0 ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION} RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \ | tar -C /usr/share -zxf - \ diff --git a/examples/docker-compose-mohist.yml b/examples/docker-compose-mohist.yml new file mode 100644 index 00000000..1407af7e --- /dev/null +++ b/examples/docker-compose-mohist.yml @@ -0,0 +1,17 @@ +version: "3.8" + +services: + mc: + image: itzg/minecraft-server + ports: + - "25565:25565" + environment: + EULA: "TRUE" + TYPE: MOHIST + VERSION: 1.12.2 + DEBUG: "true" + volumes: + - data:/data + +volumes: + data: {} diff --git a/start-deployMohist b/start-deployMohist index 4128af14..1b8338fa 100755 --- a/start-deployMohist +++ b/start-deployMohist @@ -1,17 +1,18 @@ #!/bin/bash -. ${SCRIPTS:-/}start-utils +# shellcheck source=start-utils +. "${SCRIPTS:-$(dirname "$0")}/start-utils" set -o pipefail set -e isDebugging && set -x requireVar VANILLA_VERSION -: ${MOHIST_BUILD:=lastSuccessfulBuild} +: "${MOHIST_BUILD:=lastSuccessfulBuild}" mohistJobs=https://ci.codemc.io/job/MohistMC/job/ mohistJob=${mohistJobs}Mohist-${VANILLA_VERSION}/ -if ! curl -X HEAD -o /dev/null -fsSL "${mohistJob}"; then +if ! get --exists "${mohistJob}"; then log "ERROR: mohist builds do not exist for ${VANILLA_VERSION}" log " check https://ci.codemc.io/job/MohistMC/ for available versions" log " and set VERSION accordingly" @@ -19,8 +20,7 @@ if ! curl -X HEAD -o /dev/null -fsSL "${mohistJob}"; then fi buildRelPath=$( - curl -fsSL "${mohistJob}${MOHIST_BUILD}/api/json" | - jq -r '.artifacts[0].relativePath' + get --json-path '$.artifacts[0].relativePath' "${mohistJob}${MOHIST_BUILD}/api/json" ) baseName=$(basename "${buildRelPath}") @@ -33,11 +33,11 @@ fi export SERVER="/data/${baseName}" -if [ ! -f ${SERVER} ]; then +if [ ! -f "${SERVER}" ]; then log "Downloading ${baseName}" - curl -o "${SERVER}" -fsSL "${mohistJob}${MOHIST_BUILD}/artifact/${buildRelPath}" + get -o "${SERVER}" "${mohistJob}${MOHIST_BUILD}/artifact/${buildRelPath}" fi export SKIP_LOG4J_CONFIG=true -exec ${SCRIPTS:-/}start-setupWorld "$@" +exec "${SCRIPTS:-$(dirname "$0")}/start-setupWorld" "$@"