mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-11-10 06:14:14 +00:00
Switch Quilt and Purpur to image helper (#2229)
This commit is contained in:
parent
55fb21cdd7
commit
87e2f2b177
30 changed files with 128 additions and 134 deletions
|
@ -46,7 +46,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
|||
--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
|
||||
|
||||
ARG MC_HELPER_VERSION=1.31.0
|
||||
ARG MC_HELPER_VERSION=1.32.0
|
||||
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
|
||||
# used for cache busting local copy of mc-image-helper
|
||||
ARG MC_HELPER_REV=1
|
||||
|
|
|
@ -55,14 +55,14 @@ docker run -it --rm -v ${PWD}:/scripts -e SCRIPTS=/scripts/ --entrypoint bash mc
|
|||
From within the container you can run individual scripts via the attached `/scripts/` path; however, be sure to set any environment variables expected by the scripts by either `export`ing them manually:
|
||||
|
||||
```shell script
|
||||
export VANILLA_VERSION=1.12.2
|
||||
export VERSION=1.12.2
|
||||
/scripts/start-magma
|
||||
```
|
||||
|
||||
...or pre-pending script execution:
|
||||
|
||||
```shell script
|
||||
VANILLA_VERSION=1.12.2 /scripts/start-magma
|
||||
VERSION=1.12.2 /scripts/start-magma
|
||||
```
|
||||
|
||||
> NOTE: You may want to temporarily add an `exit` statement near the end of your script to isolate execution to just the script you're developing.
|
||||
|
|
|
@ -7,7 +7,7 @@ services:
|
|||
- "25565:25565"
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: AUTO_CURSEFORGE
|
||||
MOD_PLATFORM: AUTO_CURSEFORGE
|
||||
# allocate from https://console.curseforge.com/ and set in .env file
|
||||
CF_API_KEY: ${CF_API_KEY}
|
||||
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/all-the-mods-8
|
||||
|
|
|
@ -9,7 +9,7 @@ services:
|
|||
- "25565:25565"
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
TYPE: MODRINTH
|
||||
MOD_PLATFORM: MODRINTH
|
||||
MODRINTH_PROJECT: https://modrinth.com/modpack/cobblemon-fabric/version/1.3.2
|
||||
# or for auto-upgrading to latest
|
||||
# MODRINTH_PROJECT: https://modrinth.com/modpack/cobblemon-fabric
|
||||
|
@ -18,7 +18,6 @@ services:
|
|||
# MODRINTH_VERSION: nvrqJg44
|
||||
# MODRINTH_VERSION: 1.3.2
|
||||
# MODRINTH_VERSION: "Cobblemon [Fabric] 1.3.2"
|
||||
SETUP_ONLY: "true"
|
||||
volumes:
|
||||
# attach the relative directory 'data' to the container's /data path
|
||||
- ./data:/data
|
|
@ -2,7 +2,7 @@ version: "3"
|
|||
|
||||
services:
|
||||
mc:
|
||||
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||
image: itzg/minecraft-server
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: PAPER
|
||||
|
|
|
@ -7,7 +7,7 @@ services:
|
|||
- "25565:25565"
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: AUTO_CURSEFORGE
|
||||
MOD_PLATFORM: AUTO_CURSEFORGE
|
||||
# CF_API_KEY=... must be set in .env file or as environment variable
|
||||
CF_API_KEY: ${CF_API_KEY}
|
||||
CF_SLUG: one-block-modded
|
||||
|
|
|
@ -7,7 +7,7 @@ services:
|
|||
- "25565:25565"
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: AUTO_CURSEFORGE
|
||||
MOD_PLATFORM: AUTO_CURSEFORGE
|
||||
CF_API_KEY: # allocate from https://console.curseforge.com/
|
||||
CF_SLUG: the-pixelmon-modpack
|
||||
CF_FILENAME_MATCHER: "9.1.2"
|
||||
|
|
|
@ -7,7 +7,7 @@ services:
|
|||
- "25565:25565"
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: AUTO_CURSEFORGE
|
||||
MOD_PLATFORM: AUTO_CURSEFORGE
|
||||
CF_API_KEY: # allocate from https://console.curseforge.com/
|
||||
CF_FORCE_SYNCHRONIZE: "true"
|
||||
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/valhelsia-5/files/4429560
|
||||
|
|
|
@ -7,7 +7,7 @@ services:
|
|||
- "25565:25565"
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: AUTO_CURSEFORGE
|
||||
MOD_PLATFORM: AUTO_CURSEFORGE
|
||||
CF_API_KEY: # allocate from https://console.curseforge.com/
|
||||
CF_SLUG: vault-hunters-1-18-2
|
||||
CF_FILENAME_MATCHER: "Update-10.0.0"
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 0 B After Width: | Height: | Size: 68 KiB |
Binary file not shown.
Before Width: | Height: | Size: 0 B After Width: | Height: | Size: 93 KiB |
|
@ -105,31 +105,6 @@ function fixJavaPath() {
|
|||
fi
|
||||
}
|
||||
|
||||
function resolveVersion() {
|
||||
VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
||||
|
||||
case "X$VERSION" in
|
||||
X|XLATEST|Xlatest)
|
||||
if ! VANILLA_VERSION=$(get --json-path '$.latest.release' "$VERSIONS_JSON"); then
|
||||
log "ERROR: version lookup failed: $VANILLA_VERSION"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
XSNAPSHOT|Xsnapshot)
|
||||
if ! VANILLA_VERSION=$(get --json-path '$.latest.snapshot' "$VERSIONS_JSON"); then
|
||||
log "ERROR: version lookup failed: $VANILLA_VERSION"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
VANILLA_VERSION=$VERSION
|
||||
;;
|
||||
esac
|
||||
export VANILLA_VERSION
|
||||
MAJOR_VANILLA_VERSION=$(get_major_version "$VANILLA_VERSION")
|
||||
export MAJOR_VANILLA_VERSION
|
||||
log "Resolved version given ${VERSION} into ${VANILLA_VERSION} and major version ${MAJOR_VANILLA_VERSION}"
|
||||
}
|
||||
|
||||
if ! fixJavaPath; then
|
||||
log "ERROR: could not locate path that contains java"
|
||||
|
@ -187,8 +162,6 @@ if [[ $MOD_PLATFORM ]]; then
|
|||
esac
|
||||
fi
|
||||
|
||||
resolveVersion
|
||||
|
||||
log "Resolving type given ${TYPE}"
|
||||
case "${TYPE^^}" in
|
||||
*BUKKIT|SPIGOT)
|
||||
|
@ -204,7 +177,6 @@ case "${TYPE^^}" in
|
|||
;;
|
||||
|
||||
FORGE)
|
||||
evaluateJavaCompatibilityForForge
|
||||
exec "${SCRIPTS:-/}start-deployForge" "$@"
|
||||
;;
|
||||
|
||||
|
@ -261,12 +233,6 @@ case "${TYPE^^}" in
|
|||
;;
|
||||
|
||||
CRUCIBLE)
|
||||
log "**********************************************************************"
|
||||
log "WARNING: The image tag itzg/minecraft-server:java8 is recommended"
|
||||
log " since some mods require Java 8"
|
||||
log " Exception traces reporting ClassCastException: class jdk.internal.loader.ClassLoaders\$AppClassLoader"
|
||||
log " can be fixed with java8"
|
||||
log "**********************************************************************"
|
||||
exec "${SCRIPTS:-/}start-deployCrucible" "$@"
|
||||
;;
|
||||
|
||||
|
|
|
@ -66,13 +66,11 @@ if ! mc-image-helper install-curseforge "${args[@]}"; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# grab SERVER, FAMILY and export it
|
||||
# grab SERVER, TYPE, VERSION and export it
|
||||
set -a
|
||||
# shellcheck disable=SC1090
|
||||
source "${resultsFile}"
|
||||
set +a
|
||||
# grab the version resolved from modpack
|
||||
VANILLA_VERSION="$VERSION"
|
||||
export VANILLA_VERSION
|
||||
resolveFamily
|
||||
|
||||
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
isDebugging && set -x
|
||||
|
||||
set -e
|
||||
|
@ -60,14 +61,14 @@ function downloadSpigot {
|
|||
esac
|
||||
|
||||
if [[ ${VERSION^^} = LATEST ]]; then
|
||||
VANILLA_VERSION=$(restify https://getbukkit.org/download/spigot --attribute='property=og:title' | jq -r '.[0] | .attributes | select(.property == "og:title") | .content | split(" ") | .[-1]')
|
||||
VERSION=$(restify https://getbukkit.org/download/spigot --attribute='property=og:title' | jq -r '.[0] | .attributes | select(.property == "og:title") | .content | split(" ") | .[-1]')
|
||||
fi
|
||||
|
||||
if [[ -z $downloadUrl ]]; then
|
||||
if versionLessThan 1.16.5 || ([[ ${getbukkitFlavor} = "craftbukkit" ]] && [[ ${VANILLA_VERSION} = "1.16.5" ]]); then
|
||||
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
|
||||
if versionLessThan 1.16.5 || ([[ ${getbukkitFlavor} = "craftbukkit" ]] && [[ ${VERSION} = "1.16.5" ]]); then
|
||||
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VERSION}.jar"
|
||||
else
|
||||
downloadUrl="https://download.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
|
||||
downloadUrl="https://download.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VERSION}.jar"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -108,15 +109,16 @@ EOF
|
|||
function setServerVar {
|
||||
case "$TYPE" in
|
||||
*BUKKIT|*bukkit)
|
||||
export SERVER=craftbukkit_server-${VANILLA_VERSION}.jar
|
||||
export SERVER=craftbukkit_server-${VERSION}.jar
|
||||
;;
|
||||
*)
|
||||
export SERVER=spigot_server-${VANILLA_VERSION}.jar
|
||||
export SERVER=spigot_server-${VERSION}.jar
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
if isTrue "$BUILD_SPIGOT_FROM_SOURCE" || isTrue "$BUILD_FROM_SOURCE"; then
|
||||
resolveVersion
|
||||
setServerVar
|
||||
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
||||
buildSpigotFromSource
|
||||
|
|
|
@ -6,7 +6,7 @@ set -o pipefail
|
|||
set -e
|
||||
isDebugging && set -x
|
||||
|
||||
requireVar VANILLA_VERSION
|
||||
resolveVersion
|
||||
: "${CRUCIBLE_RELEASE:=latest}"
|
||||
|
||||
crucibleReleasesUrl=https://api.github.com/repos/CrucibleMC/Crucible/releases
|
||||
|
@ -16,14 +16,14 @@ else
|
|||
crucibleReleaseUrl=${crucibleReleasesUrl}/tags/${CRUCIBLE_RELEASE}
|
||||
fi
|
||||
|
||||
if ! downloadUrl=$(get --json-path "$.assets[?(@.name =~ /Crucible-${VANILLA_VERSION}-.*\.jar/)].browser_download_url" \
|
||||
if ! downloadUrl=$(get --json-path "$.assets[?(@.name =~ /Crucible-${VERSION}-.*\.jar/)].browser_download_url" \
|
||||
--accept "application/vnd.github.v3+json" "$crucibleReleaseUrl"); then
|
||||
log "ERROR: failed to access ${CRUCIBLE_RELEASE} release of Crucible"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $downloadUrl = null ]]; then
|
||||
log "ERROR: failed to locate Crucible jar for $VANILLA_VERSION from ${CRUCIBLE_RELEASE}"
|
||||
log "ERROR: failed to locate Crucible jar for $VERSION from ${CRUCIBLE_RELEASE}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
@ -19,9 +19,10 @@ if [[ $FABRIC_LAUNCHER ]]; then
|
|||
if ! mc-image-helper install-fabric-loader \
|
||||
--results-file=${resultsFile} \
|
||||
--from-local-file="$FABRIC_LAUNCHER"; then
|
||||
log "ERROR failed to install Fabric launcher from $FABRIC_LAUNCHER"
|
||||
log "ERROR failed to use provided Fabric launcher"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Custom fabric jar url
|
||||
elif [[ $FABRIC_LAUNCHER_URL ]]; then
|
||||
if ! mc-image-helper install-fabric-loader \
|
||||
|
@ -30,19 +31,21 @@ elif [[ $FABRIC_LAUNCHER_URL ]]; then
|
|||
log "ERROR failed to install Fabric launcher from $FABRIC_LAUNCHER_URL"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Official fabric launcher
|
||||
else
|
||||
if ! mc-image-helper install-fabric-loader \
|
||||
--results-file=${resultsFile} \
|
||||
--minecraft-version="${VANILLA_VERSION}" \
|
||||
--minecraft-version="${VERSION}" \
|
||||
--installer-version="${FABRIC_LAUNCHER_VERSION}" \
|
||||
--loader-version="${FABRIC_LOADER_VERSION}"; then
|
||||
log "ERROR failed to install Fabric launcher from $VANILLA_VERSION, $FABRIC_LAUNCHER_VERSION, $FABRIC_LOADER_VERSION"
|
||||
log "ERROR failed to install Fabric launcher given $VERSION, $FABRIC_LAUNCHER_VERSION, $FABRIC_LOADER_VERSION"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# grab SERVER and export it
|
||||
# grab SERVER, etc and export it
|
||||
set -a
|
||||
# shellcheck disable=SC1090
|
||||
source "${resultsFile}"
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
|
||||
isDebugging && set -x
|
||||
|
||||
# NOTE: VERSION rather than VANILLA_VERSION is specified to allow for latest supported
|
||||
# Forge version to be selected.
|
||||
if [[ ${FORGE_INSTALLER} ]]; then
|
||||
if ! mc-image-helper install-forge \
|
||||
--output-directory=/data \
|
||||
|
|
|
@ -4,10 +4,15 @@
|
|||
. "${SCRIPTS:-/}start-utils"
|
||||
isDebugging && set -x
|
||||
|
||||
: "${VANILLA_VERSION?}"
|
||||
resolveVersion
|
||||
|
||||
if ! downloadUrl=$(get --json-path '$.link' "https://api.magmafoundation.org/api/v2/${VANILLA_VERSION}/latest"); then
|
||||
log "ERROR failed to locate latest Magma download for ${VANILLA_VERSION}. Is that version supported?"
|
||||
if ! downloadUrl=$(get --json-path '$.link' "https://api.magmafoundation.org/api/v2/${VERSION}/latest"); then
|
||||
log "ERROR failed to locate latest Magma download for ${VERSION}. Is that version supported?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $downloadUrl == null ]]; then
|
||||
log "ERROR Magma does not seem to be available for $VERSION"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
@ -48,13 +48,11 @@ if ! mc-image-helper install-modrinth-modpack "${args[@]}"; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# grab SERVER, FAMILY and export it
|
||||
# grab SERVER, TYPE, VERSION and export it
|
||||
set -a
|
||||
# shellcheck disable=SC1090
|
||||
source "${resultsFile}"
|
||||
set +a
|
||||
# grab the version resolved from modpack
|
||||
VANILLA_VERSION="$VERSION"
|
||||
export VANILLA_VERSION
|
||||
resolveFamily
|
||||
|
||||
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
||||
|
|
|
@ -6,14 +6,14 @@ set -o pipefail
|
|||
set -e
|
||||
isDebugging && set -x
|
||||
|
||||
requireVar VANILLA_VERSION
|
||||
resolveVersion
|
||||
: "${MOHIST_BUILD:=lastSuccessfulBuild}"
|
||||
|
||||
mohistJobs=https://ci.codemc.io/job/MohistMC/job/
|
||||
mohistJob=${mohistJobs}Mohist-${VANILLA_VERSION}/
|
||||
mohistJob=${mohistJobs}Mohist-${VERSION}/
|
||||
|
||||
if ! get --exists "${mohistJob}"; then
|
||||
log "ERROR: mohist builds do not exist for ${VANILLA_VERSION}"
|
||||
log "ERROR: mohist builds do not exist for ${VERSION}"
|
||||
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
|
||||
log " and set VERSION accordingly"
|
||||
exit 1
|
||||
|
@ -25,7 +25,7 @@ buildRelPath=$(
|
|||
|
||||
baseName=$(basename "${buildRelPath}")
|
||||
if [[ ${baseName} != *-server.jar* ]]; then
|
||||
log "ERROR: mohist build for ${VANILLA_VERSION} is not a valid server jar, found ${baseName}"
|
||||
log "ERROR: mohist build for ${VERSION} is not a valid server jar, found ${baseName}"
|
||||
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
|
||||
log " and set VERSION accordingly"
|
||||
exit 1
|
||||
|
|
|
@ -15,7 +15,8 @@ fi
|
|||
|
||||
: "${PUFFERFISH_BUILD:=lastSuccessfulBuild}"
|
||||
|
||||
PUFFERFISH_BUILD_JSON=$(curl -X GET -s "https://ci.pufferfish.host/job/Pufferfish-${MAJOR_VANILLA_VERSION}/${PUFFERFISH_BUILD}/api/json")
|
||||
majorVersion=$(get_major_version "$VERSION")
|
||||
PUFFERFISH_BUILD_JSON=$(curl -X GET -s "https://ci.pufferfish.host/job/Pufferfish-${majorVersion}/${PUFFERFISH_BUILD}/api/json")
|
||||
# Example: "url": "https://ci.pufferfish.host/job/Pufferfish-1.18/50/",
|
||||
PUFFERFISH_BUILD_URL=$(jq -n "$PUFFERFISH_BUILD_JSON" | jq -jc '.url // empty' )
|
||||
# Example: "fileName": "pufferfish-paperclip-1.18.2-R0.1-SNAPSHOT-reobf.jar",
|
||||
|
|
|
@ -4,8 +4,6 @@ set -eu
|
|||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
|
||||
requireVar VANILLA_VERSION
|
||||
export TYPE=QUILT
|
||||
: "${QUILT_LAUNCHER:=}"
|
||||
: "${QUILT_LAUNCHER_URL:=}"
|
||||
: "${QUILT_INSTALLER_URL:=}"
|
||||
|
@ -14,47 +12,50 @@ export TYPE=QUILT
|
|||
|
||||
isDebugging && set -x
|
||||
|
||||
# Custom quilt jar
|
||||
resultsFile=/data/.quilt.env
|
||||
|
||||
if [[ $QUILT_LAUNCHER ]]; then
|
||||
export SERVER=${QUILT_LAUNCHER}
|
||||
# Custom quilt jar url
|
||||
log "WARNING: use of QUILT_LAUNCHER is a deprecated feature."
|
||||
SERVER="$QUILT_LAUNCHER"
|
||||
export SERVER
|
||||
resolveVersion
|
||||
|
||||
export FAMILY=FABRIC
|
||||
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
||||
|
||||
elif [[ $QUILT_LAUNCHER_URL ]]; then
|
||||
export SERVER=quilt-server-$(echo -n "$QUILT_LAUNCHER_URL" | mc-image-helper hash)
|
||||
# Official quilt installer
|
||||
log "ERROR: QUILT_LAUNCHER_URL is not longer supported. Pre-download and use QUILT_LAUNCHER."
|
||||
exit 2
|
||||
|
||||
elif [[ $QUILT_INSTALLER_URL ]]; then
|
||||
if ! mc-image-helper install-quilt \
|
||||
--loader-version="$QUILT_LOADER_VERSION" \
|
||||
--minecraft-version="$VERSION" \
|
||||
--output-directory=/data \
|
||||
--results-file="$resultsFile" \
|
||||
--installer-url="$QUILT_INSTALLER_URL"; then
|
||||
log "ERROR: failed to install Quilt given custom installer URL $QUILT_INSTALLER_URL"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
else
|
||||
if [[ ${QUILT_INSTALLER_VERSION^^} = LATEST ]]; then
|
||||
log "Checking Quilt Installer version information."
|
||||
QUILT_INSTALLER_VERSION=$(maven-metadata-release https://maven.quiltmc.org/repository/release/org/quiltmc/quilt-installer/maven-metadata.xml)
|
||||
if ! mc-image-helper install-quilt \
|
||||
--loader-version="$QUILT_LOADER_VERSION" \
|
||||
--minecraft-version="$VERSION" \
|
||||
--output-directory=/data \
|
||||
--results-file="$resultsFile" \
|
||||
--installer-version="$QUILT_INSTALLER_VERSION"; then
|
||||
log "ERROR: failed to install Quilt given installer version $QUILT_INSTALLER_VERSION"
|
||||
exit 2
|
||||
fi
|
||||
if [[ ${QUILT_LOADER_VERSION^^} = LATEST ]]; then
|
||||
log "Checking Quilt Loader version information."
|
||||
QUILT_LOADER_VERSION=$(maven-metadata-release https://maven.quiltmc.org/repository/release/org/quiltmc/quilt-loader/maven-metadata.xml)
|
||||
fi
|
||||
export INSTALLER=quilt-installer-${QUILT_INSTALLER_VERSION}.jar
|
||||
export SERVER=quilt-server-${VANILLA_VERSION}-${QUILT_LOADER_VERSION}-launch.jar
|
||||
export QUILT_INSTALLER_URL="https://maven.quiltmc.org/repository/release/org/quiltmc/quilt-installer/${QUILT_INSTALLER_VERSION}/quilt-installer-${QUILT_INSTALLER_VERSION}.jar"
|
||||
|
||||
fi
|
||||
|
||||
if [[ ! -e ${SERVER} && ! -z ${QUILT_INSTALLER_URL} ]]; then
|
||||
log "Downloading and installing $QUILT_INSTALLER_URL ..."
|
||||
if ! get -o "$INSTALLER" "$QUILT_INSTALLER_URL"; then
|
||||
log "Failed to download from given location $QUILT_INSTALLER_URL"
|
||||
exit 2
|
||||
fi
|
||||
if ! java -jar ${INSTALLER} install server ${VANILLA_VERSION} ${QUILT_LOADER_VERSION} --install-dir=./ --download-server; then
|
||||
log "Failed to install $INSTALLER"
|
||||
exit 2
|
||||
fi
|
||||
if ! mv quilt-server-launch.jar ${SERVER}; then
|
||||
log "Failed to rename $SERVER"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -e ${SERVER} ]]; then
|
||||
log "$SERVER does not exist, cannot launch server!"
|
||||
exit 1
|
||||
fi
|
||||
# grab SERVER, VERSION and export it
|
||||
set -a
|
||||
# shellcheck disable=SC1090
|
||||
source "${resultsFile}"
|
||||
set +a
|
||||
|
||||
export FAMILY=FABRIC
|
||||
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
export TYPE=spongevanilla
|
||||
|
@ -24,20 +25,20 @@ esac
|
|||
if [ -z $SPONGEVERSION ]; then
|
||||
log "Choosing Version for Sponge"
|
||||
if [ "$SPONGEBRANCH" == "stable" ]; then
|
||||
SPONGEVERSION=`curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r '.buildTypes.stable.latest.version'`
|
||||
SPONGEVERSION=$(curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r '.buildTypes.stable.latest.version')
|
||||
else
|
||||
SPONGEVERSION=`curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r '.buildTypes.bleeding.latest.version'`
|
||||
SPONGEVERSION=$(curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r '.buildTypes.bleeding.latest.version')
|
||||
fi
|
||||
fi
|
||||
|
||||
VANILLA_VERSION="$SPONGEVERSION"
|
||||
export VANILLA_VERSION
|
||||
VERSION="$SPONGEVERSION"
|
||||
export VERSION
|
||||
export SERVER="spongevanilla-$SPONGEVERSION.jar"
|
||||
|
||||
if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
if [ ! -e "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
log "Downloading $SERVER ..."
|
||||
curl -sSL -o $SERVER https://repo.spongepowered.org/maven/org/spongepowered/$TYPE/$SPONGEVERSION/$SERVER
|
||||
curl -sSL -o "$SERVER" "https://repo.spongepowered.org/maven/org/spongepowered/$TYPE/$SPONGEVERSION/$SERVER"
|
||||
fi
|
||||
|
||||
export FAMILY=SPONGE
|
||||
exec ${SCRIPTS:-/}start-setupWorld "$@"
|
||||
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
||||
|
|
|
@ -5,18 +5,19 @@
|
|||
isDebugging && set -x
|
||||
set -o pipefail
|
||||
|
||||
export SERVER="minecraft_server.${VANILLA_VERSION// /_}.jar"
|
||||
resolveVersion
|
||||
export SERVER="minecraft_server.${VERSION// /_}.jar"
|
||||
|
||||
if [ ! -e "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
debug "Finding version manifest for $VANILLA_VERSION"
|
||||
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')
|
||||
debug "Finding version manifest for $VERSION"
|
||||
versionManifestUrl=$(get 'https://launchermeta.mojang.com/mc/game/version_manifest.json' | jq --arg VERSION "$VERSION" --raw-output '[.versions[]|select(.id == $VERSION)][0].url')
|
||||
result=$?
|
||||
if [ $result != 0 ]; then
|
||||
log "ERROR: failed to obtain version manifest URL ($result)"
|
||||
exit 1
|
||||
fi
|
||||
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 $VERSION"
|
||||
exit 1
|
||||
fi
|
||||
debug "Found version manifest at $versionManifestUrl"
|
||||
|
@ -25,11 +26,11 @@ if [ ! -e "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
|||
log "ERROR: failed to obtain version manifest from $versionManifestUrl ($result)"
|
||||
exit 1
|
||||
elif [ "$serverDownloadUrl" = "null" ]; then
|
||||
log "ERROR: there is not a server download for version $VANILLA_VERSION"
|
||||
log "ERROR: there is not a server download for version $VERSION"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log "Downloading $VANILLA_VERSION server..."
|
||||
log "Downloading $VERSION server..."
|
||||
debug "Downloading server from $serverDownloadUrl"
|
||||
get -o "$SERVER" "$serverDownloadUrl"
|
||||
result=$?
|
||||
|
|
|
@ -57,7 +57,7 @@ updateReleaseNumber(){
|
|||
}
|
||||
|
||||
retrieveVersionTypeNumber(){
|
||||
VERSION_NAME="Minecraft ${MAJOR_VANILLA_VERSION}"
|
||||
VERSION_NAME=$(get_major_version "$VERSION")
|
||||
minecraft_types=$(curl -X GET -s \
|
||||
"${FORGEAPI_BASE_URL}/games/${MINECRAFT_GAME_ID}/version-types" \
|
||||
-H 'Accept: application/json' -H 'x-api-key: '${MODS_FORGEAPI_KEY}'')
|
||||
|
|
|
@ -289,7 +289,7 @@ function handleModrinthProjects() {
|
|||
mc-image-helper modrinth \
|
||||
--output-directory=/data \
|
||||
--projects="${MODRINTH_PROJECTS}" \
|
||||
--game-version="${VANILLA_VERSION}" \
|
||||
--game-version="${VERSION}" \
|
||||
--loader="$loader" \
|
||||
--download-optional-dependencies="$MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES" \
|
||||
--allowed-version-type="$MODRINTH_ALLOWED_VERSION_TYPE"
|
||||
|
|
|
@ -163,7 +163,7 @@ function normalizeMemSize() {
|
|||
|
||||
function versionLessThan() {
|
||||
# Use if-else since strict mode might be enabled
|
||||
if mc-image-helper compare-versions "${VANILLA_VERSION}" lt "${1?}"; then
|
||||
if mc-image-helper compare-versions "${VERSION}" lt "${1?}"; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
|
@ -320,4 +320,28 @@ function usesPlugins() {
|
|||
return 0
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
function resolveVersion() {
|
||||
givenVersion="$VERSION"
|
||||
# shellcheck disable=SC2153
|
||||
if ! VERSION=$(mc-image-helper resolve-minecraft-version "$VERSION"); then
|
||||
exit 2
|
||||
fi
|
||||
log "Resolved version given ${givenVersion} into ${VERSION}"
|
||||
}
|
||||
|
||||
function resolveFamily() {
|
||||
case "$TYPE" in
|
||||
PAPER|SPIGOT|BUKKIT|CANYON|PUFFERFISH|PURPUR)
|
||||
FAMILY=SIGOT
|
||||
;;
|
||||
FORGE)
|
||||
FAMILY=FORGE
|
||||
;;
|
||||
FABRIC|QUILT)
|
||||
FAMILY=FABRIC
|
||||
;;
|
||||
esac
|
||||
export FAMILY
|
||||
}
|
|
@ -6,7 +6,7 @@ services:
|
|||
environment:
|
||||
EULA: "true"
|
||||
SETUP_ONLY: "TRUE"
|
||||
TYPE: AUTO_CURSEFORGE
|
||||
MOD_PLATFORM: AUTO_CURSEFORGE
|
||||
CF_API_KEY: ${CF_API_KEY}
|
||||
CF_SLUG: the-pixelmon-modpack
|
||||
CF_FILENAME_MATCHER: "9.1.2"
|
||||
|
|
|
@ -7,10 +7,7 @@ services:
|
|||
EULA: "true"
|
||||
SETUP_ONLY: "true"
|
||||
TYPE: FABRIC
|
||||
FABRIC_LAUNCHER: /servers/fake.jar
|
||||
CUSTOM_SERVER: /servers/fake.jar
|
||||
VERSION: 1.19.1
|
||||
MODRINTH_PROJECTS: fabric-api,cloth-config
|
||||
volumes:
|
||||
- ./data:/data
|
||||
- ./fake.jar:/servers/fake.jar
|
||||
|
|
Loading…
Reference in a new issue