mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-09-04 21:25:01 +00:00
Resolve SpongeVanilla latest version and fail closed on download (#4255)
Co-authored-by: LCB <me@lbellows.com>
This commit is contained in:
@@ -22,18 +22,28 @@ case "$SPONGEBRANCH" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
# If not SPONGEVERSION selected, detect last version on selected branch
|
# If not SPONGEVERSION selected, detect last version on selected branch
|
||||||
if [ -z $SPONGEVERSION ]; then
|
if [ -z "$SPONGEVERSION" ]; then
|
||||||
log "Choosing Version for Sponge"
|
log "Choosing Version for Sponge"
|
||||||
SPONGEVERSION=$(curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r --arg SPONGEBRANCH "$SPONGEBRANCH" '.buildTypes.$SPONGEBRANCH.latest.version')
|
if ! SPONGEVERSION=$(curl -fsSL "https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE" | jq -r --arg SPONGEBRANCH "$SPONGEBRANCH" '.buildTypes[$SPONGEBRANCH].latest.version'); then
|
||||||
|
logError "Failed to resolve latest SpongeVanilla version from the Sponge downloads API"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ -z $SPONGEVERSION || $SPONGEVERSION == null ]]; then
|
||||||
|
logError "Sponge downloads API did not return a version for branch $SPONGEBRANCH"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VERSION="$SPONGEVERSION"
|
VERSION="$SPONGEVERSION"
|
||||||
export VERSION
|
export VERSION
|
||||||
export SERVER="spongevanilla-$SPONGEVERSION.jar"
|
export SERVER="spongevanilla-$SPONGEVERSION.jar"
|
||||||
|
|
||||||
if [ ! -e "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
if [ ! -e "$SERVER" ] || isTrue "${FORCE_REDOWNLOAD}"; then
|
||||||
log "Downloading $SERVER ..."
|
log "Downloading $SERVER ..."
|
||||||
curl -sSL -o "$SERVER" "https://repo.spongepowered.org/maven/org/spongepowered/$TYPE/$SPONGEVERSION/$SERVER"
|
if ! curl -fsSL -o "$SERVER" "https://repo.spongepowered.org/maven/org/spongepowered/$TYPE/$SPONGEVERSION/$SERVER"; then
|
||||||
|
logError "Failed to download $SERVER"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export FAMILY=SPONGE
|
export FAMILY=SPONGE
|
||||||
|
|||||||
Reference in New Issue
Block a user