mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-16 07:12:29 +00:00
Auto-merging via docker-versions-create
This commit is contained in:
commit
1f1fa02031
4 changed files with 26 additions and 19 deletions
|
@ -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}} \
|
--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
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
ARG MC_HELPER_VERSION=1.5.2
|
ARG MC_HELPER_VERSION=1.6.1
|
||||||
RUN curl -fsSL https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
|
RUN curl -fsSL https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
|
||||||
| tar -C /usr/share -zxf - \
|
| tar -C /usr/share -zxf - \
|
||||||
&& ln -s /usr/share/mc-image-helper-${MC_HELPER_VERSION}/bin/mc-image-helper /usr/bin
|
&& ln -s /usr/share/mc-image-helper-${MC_HELPER_VERSION}/bin/mc-image-helper /usr/bin
|
||||||
|
|
|
@ -2,14 +2,17 @@
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
IFS=$'\n\t'
|
IFS=$'\n\t'
|
||||||
|
|
||||||
|
# shellcheck source=start-utils
|
||||||
. ${SCRIPTS:-/}start-utils
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
|
||||||
: ${EULA:=}
|
: "${EULA:=}"
|
||||||
: ${PROXY:=}
|
: "${PROXY:=}"
|
||||||
: ${RCON_PASSWORD_FILE:=}
|
: "${RCON_PASSWORD_FILE:=}"
|
||||||
|
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
|
|
||||||
|
isDebugging && set -x
|
||||||
|
|
||||||
#umask 002
|
#umask 002
|
||||||
export HOME=/data
|
export HOME=/data
|
||||||
|
|
||||||
|
@ -63,10 +66,16 @@ export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.js
|
||||||
|
|
||||||
case "X$VERSION" in
|
case "X$VERSION" in
|
||||||
X|XLATEST|Xlatest)
|
X|XLATEST|Xlatest)
|
||||||
VANILLA_VERSION=$(curl -fsSL $VERSIONS_JSON | jq -r '.latest.release')
|
if ! VANILLA_VERSION=$(get --json-path '$.latest.release' "$VERSIONS_JSON"); then
|
||||||
|
log "ERROR: version lookup failed: $VANILLA_VERSION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
XSNAPSHOT|Xsnapshot)
|
XSNAPSHOT|Xsnapshot)
|
||||||
VANILLA_VERSION=$(curl -fsSL $VERSIONS_JSON | jq -r '.latest.snapshot')
|
if ! VANILLA_VERSION=$(get --json-path '$.latest.snapshot' "$VERSIONS_JSON"); then
|
||||||
|
log "ERROR: version lookup failed: $VANILLA_VERSION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
VANILLA_VERSION=$VERSION
|
VANILLA_VERSION=$VERSION
|
||||||
|
@ -122,7 +131,7 @@ case "${TYPE^^}" in
|
||||||
;;
|
;;
|
||||||
|
|
||||||
VANILLA)
|
VANILLA)
|
||||||
exec ${SCRIPTS:-/}start-deployVanilla "$@"
|
exec "${SCRIPTS:-/}start-deployVanilla" "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
SPONGEVANILLA)
|
SPONGEVANILLA)
|
||||||
|
|
|
@ -1,41 +1,39 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
# shellcheck source=start-utils
|
||||||
|
. "${SCRIPTS:-/}start-utils"
|
||||||
isDebugging && set -x
|
isDebugging && set -x
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
export SERVER="minecraft_server.${VANILLA_VERSION// /_}.jar"
|
export SERVER="minecraft_server.${VANILLA_VERSION// /_}.jar"
|
||||||
|
|
||||||
if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
if [ ! -e "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||||
log "Downloading $SERVER ..."
|
log "Downloading $SERVER ..."
|
||||||
debug "Finding version manifest for $VANILLA_VERSION"
|
debug "Finding version manifest for $VANILLA_VERSION"
|
||||||
versionManifestUrl=$(curl -fsSL 'https://launchermeta.mojang.com/mc/game/version_manifest.json' | jq --arg VANILLA_VERSION "$VANILLA_VERSION" --raw-output '[.versions[]|select(.id == $VANILLA_VERSION)][0].url')
|
versionManifestUrl=$(get 'https://launchermeta.mojang.com/mc/game/version_manifest.json' | jq --arg VANILLA_VERSION "$VANILLA_VERSION" --raw-output '[.versions[]|select(.id == $VANILLA_VERSION)][0].url')
|
||||||
result=$?
|
result=$?
|
||||||
if [ $result != 0 ]; then
|
if [ $result != 0 ]; then
|
||||||
log "ERROR failed to obtain version manifest URL ($result)"
|
log "ERROR failed to obtain version manifest URL ($result)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ $versionManifestUrl = "null" ]; then
|
if [ "$versionManifestUrl" = "null" ]; then
|
||||||
log "ERROR couldn't find a matching manifest entry for $VANILLA_VERSION"
|
log "ERROR couldn't find a matching manifest entry for $VANILLA_VERSION"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
debug "Found version manifest at $versionManifestUrl"
|
debug "Found version manifest at $versionManifestUrl"
|
||||||
|
|
||||||
serverDownloadUrl=$(curl -fsSL ${versionManifestUrl} | jq --raw-output '.downloads.server.url')
|
serverDownloadUrl=$(get --json-path '$.downloads.server.url' "${versionManifestUrl}")
|
||||||
result=$?
|
result=$?
|
||||||
if [ $result != 0 ]; then
|
if [ $result != 0 ]; then
|
||||||
log "ERROR failed to obtain version manifest from $versionManifestUrl ($result)"
|
log "ERROR failed to obtain version manifest from $versionManifestUrl ($result)"
|
||||||
exit 1
|
exit 1
|
||||||
elif [ $serverDownloadUrl = null ]; then
|
elif [ "$serverDownloadUrl" = "null" ]; then
|
||||||
log "ERROR version $VANILLA_VERSION does not provide a server download"
|
log "ERROR version $VANILLA_VERSION does not provide a server download"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
debug "Downloading server from $serverDownloadUrl"
|
debug "Downloading server from $serverDownloadUrl"
|
||||||
if isDebugging; then
|
get -o "$SERVER" "$serverDownloadUrl"
|
||||||
verbose=-v
|
|
||||||
fi
|
|
||||||
curl $verbose -fsSL -o $SERVER $serverDownloadUrl
|
|
||||||
result=$?
|
result=$?
|
||||||
if [ $result != 0 ]; then
|
if [ $result != 0 ]; then
|
||||||
log "ERROR failed to download server from $serverDownloadUrl ($result)"
|
log "ERROR failed to download server from $serverDownloadUrl ($result)"
|
||||||
|
@ -45,4 +43,4 @@ fi
|
||||||
|
|
||||||
isDebugging && ls -l
|
isDebugging && ls -l
|
||||||
|
|
||||||
exec ${SCRIPTS:-/}start-setupWorld $@
|
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
||||||
|
|
|
@ -183,7 +183,7 @@ function removeOldMods {
|
||||||
|
|
||||||
function get() {
|
function get() {
|
||||||
local flags=()
|
local flags=()
|
||||||
if isDebugging; then
|
if isTrue "${DEBUG_GET:-false}"; then
|
||||||
flags+=("--debug")
|
flags+=("--debug")
|
||||||
fi
|
fi
|
||||||
mc-image-helper "${flags[@]}" get "$@"
|
mc-image-helper "${flags[@]}" get "$@"
|
||||||
|
|
Loading…
Reference in a new issue