Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
itzg authored Dec 4, 2024
1 parent 86354f5 commit 350bada
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
15 changes: 7 additions & 8 deletions examples/docker-compose-ftba.yml → examples/ftba/compose.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
services:
mc:
# FTBA support is only available in non-Alpine images
image: itzg/minecraft-server:${IMAGE_TAG:-java8-multiarch}
image: itzg/minecraft-server
ports:
# expose the Minecraft server port outside of container
- 25565:25565
- "25565:25565"
environment:
# REQUIRED for all types
EULA: "TRUE"
# Set server type (vs the default of vanilla)
TYPE: FTBA
# Use Pack ID from https://ftb.neptunepowered.org/pack/ftb-presents-direwolf20-1-12/
FTB_MODPACK_ID: "31"
FTB_MODPACK_VERSION_ID: ""
# Use Pack ID from https://www.feed-the-beast.com/modpacks/119-ftb-presents-direwolf20-120?tab=about
FTB_MODPACK_ID: "119"
# FTB_MODPACK_VERSION_ID: ""
volumes:
# use a named, managed volume for data volume
- ftba:/data
- data:/data

volumes:
# declared the named volume, but use default/local storage engine
ftba: {}
data: {}
17 changes: 12 additions & 5 deletions scripts/start-deployFTBA
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

: "${FTB_FORCE_REINSTALL:=false}"
: "${FTB_BASE_URL:=https://api.feed-the-beast.com/v1/modpacks}"
# Legacy base URL was https://api.modpacks.ch

ftbInstallMarker=".ftb-installed"

Expand Down Expand Up @@ -29,7 +31,7 @@ if ! [[ ${FTB_MODPACK_ID} =~ [0-9]+ ]]; then
fi

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 "${FTB_BASE_URL}/public/modpack/${FTB_MODPACK_ID}" | jq -r '.versions | sort_by(.updated)[-1].id'); then
logError "Unable to resolve latest modpack version ID for modpack ${FTB_MODPACK_ID}"
exit 1
fi
Expand All @@ -42,14 +44,19 @@ if isTrue "$FTB_FORCE_REINSTALL" || ! [ -f "${ftbInstallMarker}" ] || [ "$(cat "
ftbInstaller=/data/ftb-installer
arm=
if ! [[ -f "${ftbInstaller}" ]]; then
log "Downloading FTB installer"
if [ "$(uname -m)" == "aarch64" ]; then
log "Downloading ARM installer"
log "Downloading FTB installer for ARM"
arm="/arm"
else
log "Downloading x86 installer"
log "Downloading FTB installer for x86"
fi
# Example: https://api.feed-the-beast.com/v1/modpacks/public/modpack/119/12252/server/linux
# https://api.feed-the-beast.com/v1/modpacks/public/modpack/119/12252/server/arm/linux
# 1-1 is a placeholder modpack for just grabbing the installer
if ! get -o "${ftbInstaller}" "${FTB_BASE_URL}/public/modpack/1/1/server${arm}/linux"; then
logError "Failed to download FTB installer"
exit 1
fi
curl -fsSL https://api.modpacks.ch/public/modpack/1/1/server${arm}/linux -o "${ftbInstaller}"
chmod +x "${ftbInstaller}"
fi

Expand Down

0 comments on commit 350bada

Please sign in to comment.