Allowed FTB_MODPACK_VERSION_ID to be an empty value

#1081
This commit is contained in:
Geoff Bourne 2021-10-23 09:40:36 -05:00
parent e20dd63f76
commit 2e8f27a8ef
2 changed files with 5 additions and 4 deletions

View File

@ -3,7 +3,7 @@ version: "3.8"
services: services:
mc: mc:
# FTBA support is only available in non-Alpine images # FTBA support is only available in non-Alpine images
image: itzg/minecraft-server:java8-multiarch image: itzg/minecraft-server:${IMAGE_TAG:-java8-multiarch}
ports: ports:
# expose the Minecraft server port outside of container # expose the Minecraft server port outside of container
- 25565:25565 - 25565:25565
@ -14,10 +14,11 @@ services:
TYPE: FTBA TYPE: FTBA
# Use Pack ID from https://ftb.neptunepowered.org/pack/ftb-presents-direwolf20-1-12/ # Use Pack ID from https://ftb.neptunepowered.org/pack/ftb-presents-direwolf20-1-12/
FTB_MODPACK_ID: "31" FTB_MODPACK_ID: "31"
FTB_MODPACK_VERSION_ID: ""
volumes: volumes:
# use a named, managed volume for data volume # use a named, managed volume for data volume
- mc_ftb:/data - ftba:/data
volumes: volumes:
# declared the named volume, but use default/local storage engine # declared the named volume, but use default/local storage engine
mc_ftb: {} ftba: {}

View File

@ -16,7 +16,7 @@ if ! [[ ${FTB_MODPACK_ID} =~ [0-9]+ ]]; then
exit 1 exit 1
fi fi
if ! [[ -v FTB_MODPACK_VERSION_ID ]]; then if [[ ! $FTB_MODPACK_VERSION_ID ]]; then
if ! FTB_MODPACK_VERSION_ID=$(curl -fsSL https://api.modpacks.ch/public/modpack/${FTB_MODPACK_ID} | jq -r '.versions | sort_by(.updated)[-1].id'); then if ! FTB_MODPACK_VERSION_ID=$(curl -fsSL https://api.modpacks.ch/public/modpack/${FTB_MODPACK_ID} | jq -r '.versions | sort_by(.updated)[-1].id'); then
log "ERROR unable to resolve latest modpack version ID for modpack ${FTB_MODPACK_ID}" log "ERROR unable to resolve latest modpack version ID for modpack ${FTB_MODPACK_ID}"
exit 1 exit 1