mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-10-19 09:28:11 +00:00
Add release selection for the GitHub-released server types (#4339)
This commit is contained in:
1 parent
2ae1097bb9
commit
dbb0909282
24 files changed
+225
-63
No files matched your search
@@ -10,27 +10,22 @@ resolveVersion
|
||||
: "${ARCLIGHT_RELEASE:=latest}"
|
||||
: "${ARCLIGHT_TYPE:=neoforge}"
|
||||
|
||||
arclightReleasesUrl=https://api.github.com/repos/IzzelAliz/Arclight/releases
|
||||
if [[ ${ARCLIGHT_RELEASE^^} = LATEST ]]; then
|
||||
arclightReleaseUrl=${arclightReleasesUrl}/latest
|
||||
else
|
||||
arclightReleaseUrl=${arclightReleasesUrl}/tags/${ARCLIGHT_RELEASE}
|
||||
fi
|
||||
# An omitted --release-tag means the latest release, so only pass it when a
|
||||
# specific release was requested
|
||||
arclightReleaseArgs=()
|
||||
[[ ${ARCLIGHT_RELEASE} == latest ]] || arclightReleaseArgs+=(--release-tag="${ARCLIGHT_RELEASE}")
|
||||
|
||||
if ! downloadUrl=$(get --json-path "$.assets[?(@.name =~ /arclight-${ARCLIGHT_TYPE,,}-${VERSION}-.*\.jar/)].browser_download_url" \
|
||||
--accept "application/vnd.github.v3+json" "$arclightReleaseUrl"); then
|
||||
logError "Failed to access ${ARCLIGHT_RELEASE} release of Arclight"
|
||||
exit 1
|
||||
fi
|
||||
arclightRepo=IzzelAliz/Arclight
|
||||
|
||||
if [[ $downloadUrl = null ]]; then
|
||||
logError "Failed to locate Arclight jar for $VERSION from ${ARCLIGHT_RELEASE}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log "Downloading Arclight from $downloadUrl"
|
||||
if ! SERVER=$(get --skip-existing --output-filename -o /data "$downloadUrl"); then
|
||||
logError "Arclight jar from $downloadUrl"
|
||||
log "Downloading Arclight ${VERSION} ${ARCLIGHT_TYPE,,} from the ${ARCLIGHT_RELEASE} release"
|
||||
if ! SERVER=$(mc-image-helper github download-asset \
|
||||
"${arclightReleaseArgs[@]}" \
|
||||
--output-directory=/data \
|
||||
--name-pattern="^arclight-${ARCLIGHT_TYPE,,}-${VERSION}-.+\.jar$" \
|
||||
${arclightRepo}
|
||||
); then
|
||||
logError "Failed to download Arclight jar for ${VERSION} from the ${ARCLIGHT_RELEASE} release"
|
||||
logError "Ensure ARCLIGHT_RELEASE is one of the releases at ${arclightReleasesUrl}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -9,49 +9,43 @@ isDebugging && set -x
|
||||
resolveVersion
|
||||
: "${CRUCIBLE_RELEASE:=latest}"
|
||||
|
||||
crucibleReleasesUrl=https://api.github.com/repos/CrucibleMC/Crucible/releases
|
||||
if [[ ${CRUCIBLE_RELEASE^^} = LATEST ]]; then
|
||||
crucibleReleaseUrl=${crucibleReleasesUrl}/latest
|
||||
else
|
||||
crucibleReleaseUrl=${crucibleReleasesUrl}/tags/${CRUCIBLE_RELEASE}
|
||||
fi
|
||||
# An omitted --release-tag means the latest release, so only pass it when a
|
||||
# specific release was requested
|
||||
crucibleReleaseArgs=()
|
||||
[[ ${CRUCIBLE_RELEASE} == latest ]] || crucibleReleaseArgs+=(--release-tag="${CRUCIBLE_RELEASE}")
|
||||
|
||||
if ! downloadUrl=$(get --json-path "$.assets[?(@.name =~ /Crucible-${VERSION}-.*\.jar/)].browser_download_url" \
|
||||
--accept "application/vnd.github.v3+json" "$crucibleReleaseUrl"); then
|
||||
logError "Failed to access ${CRUCIBLE_RELEASE} release of Crucible"
|
||||
exit 1
|
||||
fi
|
||||
crucibleRepo=CrucibleMC/Crucible
|
||||
|
||||
if [[ $downloadUrl = null ]]; then
|
||||
logError "Failed to locate Crucible jar for $VERSION from ${CRUCIBLE_RELEASE}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log "Downloading Crucible from $downloadUrl"
|
||||
if ! SERVER=$(get --skip-existing --output-filename -o /data "$downloadUrl"); then
|
||||
logError "Crucible jar from $downloadUrl"
|
||||
log "Downloading Crucible ${VERSION} from the ${CRUCIBLE_RELEASE} release"
|
||||
if ! SERVER=$(mc-image-helper github download-asset \
|
||||
"${crucibleReleaseArgs[@]}" \
|
||||
--output-directory=/data \
|
||||
--name-pattern="^Crucible-${VERSION}-.+\.jar$" \
|
||||
${crucibleRepo}
|
||||
); then
|
||||
logError "Failed to download Crucible jar for ${VERSION} from the ${CRUCIBLE_RELEASE} release"
|
||||
logError "Ensure CRUCIBLE_RELEASE is one of the releases at ${crucibleReleasesUrl}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
librariesDir=/data/libraries
|
||||
if [ ! -d "$librariesDir" ]; then
|
||||
if ! librariesUrl=$(get --json-path "$.assets[?(@.name == 'libraries.zip')].browser_download_url" \
|
||||
--accept "application/vnd.github.v3+json" "$crucibleReleaseUrl"); then
|
||||
logError "Failed to access ${CRUCIBLE_RELEASE} release of Crucible for libraries"
|
||||
if ! librariesZip=$(mc-image-helper github download-asset \
|
||||
"${crucibleReleaseArgs[@]}" \
|
||||
--output-directory=/tmp \
|
||||
--name-pattern="^libraries\.zip$" \
|
||||
${crucibleRepo}
|
||||
); then
|
||||
logError "Failed to download Crucible libraries from the ${CRUCIBLE_RELEASE} release"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log "Downloading Crucible libraries"
|
||||
if ! get -o /tmp/libraries.zip "$librariesUrl"; then
|
||||
logError "Failed to download Crucible libraries from $librariesUrl"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! unzip /tmp/libraries.zip -d "$librariesDir"; then
|
||||
if ! unzip "$librariesZip" -d "$librariesDir"; then
|
||||
logError "Failed to unzip Crucible libraries"
|
||||
exit 1
|
||||
fi
|
||||
rm /tmp/libraries.zip
|
||||
rm "$librariesZip"
|
||||
fi
|
||||
|
||||
export SERVER
|
||||
|
||||
@@ -4,12 +4,21 @@
|
||||
. "$(dirname "$0")/start-utils"
|
||||
isDebugging && set -x
|
||||
|
||||
if ! SERVER=$(mc-image-helper github download-latest-asset \
|
||||
: "${KETTING_RELEASE:=latest}"
|
||||
|
||||
# Only pass --release-tag when a specific release was requested; helper treats
|
||||
# omitted as latest
|
||||
kettingReleaseArgs=()
|
||||
[[ ${KETTING_RELEASE} == latest ]] || kettingReleaseArgs+=(--release-tag="${KETTING_RELEASE}")
|
||||
|
||||
if ! SERVER=$(mc-image-helper github download-asset \
|
||||
"${kettingReleaseArgs[@]}" \
|
||||
--output-directory=/data \
|
||||
--name-pattern="kettinglauncher-.+?(?<!-sources)\.jar" \
|
||||
kettingpowered/kettinglauncher
|
||||
); then
|
||||
logError "Failed to download Ketting launcher"
|
||||
logError "Failed to download Ketting launcher release ${KETTING_RELEASE}"
|
||||
logError "Ensure KETTING_RELEASE is one of the releases at https://github.com/kettingpowered/kettinglauncher/releases"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -4,12 +4,21 @@
|
||||
. "$(dirname "$0")/start-utils"
|
||||
isDebugging && set -x
|
||||
|
||||
if ! SERVER=$(mc-image-helper github download-latest-asset \
|
||||
: "${NANOLIMBO_RELEASE:=latest}"
|
||||
|
||||
# Only pass --release-tag when a specific release was requested; helper treats
|
||||
# omitted as latest
|
||||
nanolimboReleaseArgs=()
|
||||
[[ ${NANOLIMBO_RELEASE} == latest ]] || nanolimboReleaseArgs+=(--release-tag="${NANOLIMBO_RELEASE}")
|
||||
|
||||
if ! SERVER=$(mc-image-helper github download-asset \
|
||||
"${nanolimboReleaseArgs[@]}" \
|
||||
--output-directory=/data \
|
||||
--name-pattern="NanoLimbo(-.+?(?<!-sources))?\.jar" \
|
||||
BoomEaro/NanoLimbo
|
||||
); then
|
||||
logError "Failed to download NanoLimbo"
|
||||
logError "Failed to download NanoLimbo release ${NANOLIMBO_RELEASE}"
|
||||
logError "Ensure NANOLIMBO_RELEASE is one of the releases at https://github.com/BoomEaro/NanoLimbo/releases"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -13,21 +13,30 @@ if [ "${VERSION}" != "b1.7.3" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# : "${POSEIDON_RELEASE:=latest}" placeholder until I figure out how to add version selection with mc-image-helper
|
||||
: "${POSEIDON_RELEASE:=latest}"
|
||||
: "${POSEIDON_TYPE:=poseidon}"
|
||||
|
||||
# Only pass --release-tag when a specific release was requested; helper treats
|
||||
# omitted as latest
|
||||
poseidonReleaseArgs=()
|
||||
[[ ${POSEIDON_RELEASE} == latest ]] || poseidonReleaseArgs+=(--release-tag="${POSEIDON_RELEASE}")
|
||||
|
||||
if [[ ${POSEIDON_TYPE^^} = UBERBUKKIT ]]; then
|
||||
poseidonRepo="Moresteck/uberbukkit"
|
||||
else
|
||||
poseidonRepo="retromcorg/Project-Poseidon"
|
||||
fi
|
||||
|
||||
if ! SERVER=$(mc-image-helper github download-latest-asset \
|
||||
poseidonReleasesUrl=https://github.com/${poseidonRepo}/releases
|
||||
|
||||
if ! SERVER=$(mc-image-helper github download-asset \
|
||||
"${poseidonReleaseArgs[@]}" \
|
||||
--output-directory=/data \
|
||||
--name-pattern="^(?!original-).+\.jar" \
|
||||
${poseidonRepo}
|
||||
); then
|
||||
logError "Failed to download ${POSEIDON_TYPE}"
|
||||
logError "Failed to download ${POSEIDON_TYPE} release ${POSEIDON_RELEASE}"
|
||||
logError "Ensure POSEIDON_RELEASE is one of the releases at ${poseidonReleasesUrl}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -26,20 +26,40 @@ if [[ $(getDistro) == alpine ]]; then
|
||||
pumpkinAsset+="-musl"
|
||||
fi
|
||||
|
||||
pumpkinReleasesUrl=https://github.com/Pumpkin-MC/Pumpkin/releases
|
||||
: "${PUMPKIN_RELEASE:=latest}"
|
||||
|
||||
# Only pass --release-tag when a specific release was requested; helper treats
|
||||
# omitted as latest
|
||||
pumpkinReleaseArgs=()
|
||||
[[ ${PUMPKIN_RELEASE} == latest ]] || pumpkinReleaseArgs+=(--release-tag="${PUMPKIN_RELEASE}")
|
||||
|
||||
# The asset is downloaded to a fixed filename, so discard a previously
|
||||
# downloaded executable when a different release is requested
|
||||
pumpkinReleaseMarker=/data/.pumpkin-release
|
||||
if [[ -f "${pumpkinReleaseMarker}" && $(<"${pumpkinReleaseMarker}") != "${PUMPKIN_RELEASE}" ]]; then
|
||||
log "Switching Pumpkin release from $(<"${pumpkinReleaseMarker}") to ${PUMPKIN_RELEASE}"
|
||||
rm -f "/data/${pumpkinAsset}"
|
||||
fi
|
||||
|
||||
if isTrue "${FORCE_REDOWNLOAD:-false}"; then
|
||||
log "Forcing re-download of ${pumpkinAsset}"
|
||||
rm -f "/data/${pumpkinAsset}"
|
||||
fi
|
||||
|
||||
if ! SERVER=$(mc-image-helper github download-latest-asset \
|
||||
if ! SERVER=$(mc-image-helper github download-asset \
|
||||
"${pumpkinReleaseArgs[@]}" \
|
||||
--output-directory=/data \
|
||||
--name-pattern="^${pumpkinAsset}$" \
|
||||
Pumpkin-MC/Pumpkin
|
||||
); then
|
||||
logError "Failed to download ${pumpkinAsset} from the latest Pumpkin release"
|
||||
logError "Failed to download ${pumpkinAsset} from the Pumpkin release ${PUMPKIN_RELEASE}"
|
||||
logError "Ensure PUMPKIN_RELEASE is one of the releases at ${pumpkinReleasesUrl}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf '%s' "${PUMPKIN_RELEASE}" > "${pumpkinReleaseMarker}"
|
||||
|
||||
log "Using Pumpkin server executable ${SERVER}"
|
||||
if [[ ! -x "${SERVER}" ]]; then
|
||||
chmod +x "${SERVER}"
|
||||
|
||||
Reference in new issue
Block a user