Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/misc/contributing/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion examples/atm8/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 changes: 1 addition & 1 deletion examples/modrinth-paper/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3"

services:
mc:
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
image: itzg/minecraft-server
environment:
EULA: "true"
TYPE: PAPER
Expand Down
2 changes: 1 addition & 1 deletion examples/one-block-modded/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/pixelmon/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion examples/valhesia5/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/vault-hunters-1-18-2/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Binary file modified notes/Going from docker run to compose.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified notes/start-script-flow.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 0 additions & 34 deletions scripts/start-configuration
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -187,8 +162,6 @@ if [[ $MOD_PLATFORM ]]; then
esac
fi

resolveVersion

log "Resolving type given ${TYPE}"
case "${TYPE^^}" in
*BUKKIT|SPIGOT)
Expand All @@ -204,7 +177,6 @@ case "${TYPE^^}" in
;;

FORGE)
evaluateJavaCompatibilityForForge
exec "${SCRIPTS:-/}start-deployForge" "$@"
;;

Expand Down Expand Up @@ -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" "$@"
;;

Expand Down
6 changes: 2 additions & 4 deletions scripts/start-deployAutoCF
Original file line number Diff line number Diff line change
Expand Up @@ -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" "$@"
16 changes: 9 additions & 7 deletions scripts/start-deployBukkitSpigot
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

. ${SCRIPTS:-/}start-utils
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
isDebugging && set -x

set -e
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions scripts/start-deployCrucible
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
11 changes: 7 additions & 4 deletions scripts/start-deployFabric
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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}"
Expand Down
2 changes: 0 additions & 2 deletions scripts/start-deployForge
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
11 changes: 8 additions & 3 deletions scripts/start-deployMagma
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 2 additions & 4 deletions scripts/start-deployModrinth
Original file line number Diff line number Diff line change
Expand Up @@ -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" "$@"
8 changes: 4 additions & 4 deletions scripts/start-deployMohist
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion scripts/start-deployPufferfish
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading