Auto-merging via docker-versions-create

This commit is contained in:
Geoff Bourne
2021-10-17 14:53:04 -05:00
9 changed files with 82 additions and 56 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \ --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 --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
ARG MC_HELPER_VERSION=1.8.1 ARG MC_HELPER_VERSION=1.9.2
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION} ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \ RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
| tar -C /usr/share -zxf - \ | tar -C /usr/share -zxf - \
+9 -1
View File
@@ -64,6 +64,7 @@ By default, the container will download the latest version of the "vanilla" [Min
* [Optional plugins, mods, and config attach points](#optional-plugins-mods-and-config-attach-points) * [Optional plugins, mods, and config attach points](#optional-plugins-mods-and-config-attach-points)
* [Auto-downloading SpigotMC/Bukkit/PaperMC plugins](#auto-downloading-spigotmcbukkitpapermc-plugins) * [Auto-downloading SpigotMC/Bukkit/PaperMC plugins](#auto-downloading-spigotmcbukkitpapermc-plugins)
* [Downloadable mod/plugin pack for Forge, Bukkit, and Spigot Servers](#downloadable-modplugin-pack-for-forge-bukkit-and-spigot-servers) * [Downloadable mod/plugin pack for Forge, Bukkit, and Spigot Servers](#downloadable-modplugin-pack-for-forge-bukkit-and-spigot-servers)
* [Mod/Plugin URL Listing File](#modplugin-url-listing-file)
* [Remove old mods/plugins](#remove-old-modsplugins) * [Remove old mods/plugins](#remove-old-modsplugins)
* [Working with world data](#working-with-world-data) * [Working with world data](#working-with-world-data)
* [Downloadable world](#downloadable-world) * [Downloadable world](#downloadable-world)
@@ -129,7 +130,7 @@ By default, the container will download the latest version of the "vanilla" [Min
* [Enabling Autopause](#enabling-autopause) * [Enabling Autopause](#enabling-autopause)
* [Running on RaspberryPi](#running-on-raspberrypi) * [Running on RaspberryPi](#running-on-raspberrypi)
<!-- Added by: runner, at: Sat Oct 9 16:34:51 UTC 2021 --> <!-- Added by: runner, at: Sun Oct 17 19:43:58 UTC 2021 -->
<!--te--> <!--te-->
@@ -548,6 +549,13 @@ docker run -d -v /path/on/host:/data ... \
-e FABRIC_INSTALLER_URL=http://HOST/fabric-installer-0.5.0.32.jar ... -e FABRIC_INSTALLER_URL=http://HOST/fabric-installer-0.5.0.32.jar ...
``` ```
A specific loader version can be requested using `FABRIC_LOADER_VERSION`, such as:
```
docker run -d -v /path/on/host:/data ... \
-e FABRIC_LOADER_VERSION=0.11.7
```
In order to add mods, you have two options: In order to add mods, you have two options:
### Running a Limbo server ### Running a Limbo server
+1
View File
@@ -0,0 +1 @@
/data/
+3 -2
View File
@@ -2,15 +2,16 @@ version: "3.8"
services: services:
mc: mc:
image: itzg/minecraft-server:java8 image: itzg/minecraft-server
ports: ports:
# expose the Minecraft server port outside of container # expose the Minecraft server port outside of container
- 25565:25565 - "25565:25565"
environment: environment:
# REQUIRED for all types # REQUIRED for all types
EULA: "TRUE" EULA: "TRUE"
# Set server type (vs the default of vanilla) # Set server type (vs the default of vanilla)
TYPE: FORGE TYPE: FORGE
DEBUG: "true"
volumes: volumes:
# use a named, managed volume for data volume # use a named, managed volume for data volume
- mc_forge:/data - mc_forge:/data
+17
View File
@@ -0,0 +1,17 @@
version: "3.8"
services:
mc:
image: itzg/minecraft-server
ports:
- "25565:25565"
environment:
EULA: "TRUE"
TYPE: MOHIST
VERSION: 1.12.2
DEBUG: "true"
volumes:
- data:/data
volumes:
data: {}
+9 -1
View File
@@ -14,6 +14,7 @@ if [[ ! -e ${SERVER} ]]; then
: ${FABRIC_INSTALLER:=} : ${FABRIC_INSTALLER:=}
: ${FABRIC_INSTALLER_URL:=} : ${FABRIC_INSTALLER_URL:=}
: ${FABRIC_LOADER_VERSION:=LATEST}
: ${FABRIC_INSTALLER_VERSION:=${FABRICVERSION:-LATEST}} : ${FABRIC_INSTALLER_VERSION:=${FABRICVERSION:-LATEST}}
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
@@ -31,6 +32,12 @@ if [[ ! -e ${SERVER} ]]; then
exit 2 exit 2
fi fi
if [[ -z $FABRIC_LOADER_VERSION || ${FABRIC_LOADER_VERSION^^} = LATEST ]]; then
log "Checking Fabric Loader version information."
FABRIC_LOADER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-loader/maven-metadata.xml)
fi
if [[ ! -e $FABRIC_INSTALLER ]]; then if [[ ! -e $FABRIC_INSTALLER ]]; then
log "Downloading $FABRIC_INSTALLER_URL ..." log "Downloading $FABRIC_INSTALLER_URL ..."
if ! get -o "$FABRIC_INSTALLER" "$FABRIC_INSTALLER_URL"; then if ! get -o "$FABRIC_INSTALLER" "$FABRIC_INSTALLER_URL"; then
@@ -39,13 +46,14 @@ if [[ ! -e ${SERVER} ]]; then
fi fi
fi fi
log "Installing Fabric ${VANILLA_VERSION} using $FABRIC_INSTALLER" log "Installing Fabric ${VANILLA_VERSION} using $FABRIC_INSTALLER with loader version $FABRIC_LOADER_VERSION"
tries=3 tries=3
set +e set +e
while ((--tries >= 0)); do while ((--tries >= 0)); do
java -jar $FABRIC_INSTALLER server \ java -jar $FABRIC_INSTALLER server \
-mcversion $VANILLA_VERSION \ -mcversion $VANILLA_VERSION \
-loader $FABRIC_LOADER_VERSION \
-downloadMinecraft \ -downloadMinecraft \
-dir /data -dir /data
if [[ $? == 0 ]]; then if [[ $? == 0 ]]; then
+26 -18
View File
@@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
. ${SCRIPTS:-/}start-utils : "${FORGEVERSION:=RECOMMENDED}"
: ${FORGEVERSION:=RECOMMENDED}
# shellcheck source=start-utils
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
isDebugging && set -x isDebugging && set -x
get_installer() { get_installer() {
@@ -16,7 +18,7 @@ get_installer() {
for fn in $forgeFileNames; do for fn in $forgeFileNames; do
downloadUrl=https://maven.minecraftforge.net/net/minecraftforge/forge/$fn downloadUrl=https://maven.minecraftforge.net/net/minecraftforge/forge/$fn
log "...trying $downloadUrl" log "...trying $downloadUrl"
if curl -o $FORGE_INSTALLER -fsSL $downloadUrl; then if get -o "$FORGE_INSTALLER" "$downloadUrl"; then
return return
fi fi
done done
@@ -24,7 +26,7 @@ get_installer() {
exit 2 exit 2
else else
log "Downloading $FORGE_INSTALLER_URL ..." log "Downloading $FORGE_INSTALLER_URL ..."
if ! curl -o $FORGE_INSTALLER -fsSL $FORGE_INSTALLER_URL; then if ! get -o "$FORGE_INSTALLER" "$FORGE_INSTALLER_URL"; then
log "Failed to download from given location $FORGE_INSTALLER_URL" log "Failed to download from given location $FORGE_INSTALLER_URL"
exit 2 exit 2
fi fi
@@ -32,20 +34,19 @@ get_installer() {
} }
install() { install() {
if [ ! -e $FORGE_INSTALLER ]; then if [ ! -e "$FORGE_INSTALLER" ]; then
get_installer $normForgeVersion $shortForgeVersion get_installer "$normForgeVersion" "$shortForgeVersion"
fi fi
log "Installing Forge $shortForgeVersion using $FORGE_INSTALLER" log "Installing Forge $shortForgeVersion using $FORGE_INSTALLER"
mkdir -p mods mkdir -p mods
tries=3 tries=3
while ((--tries >= 0)); do while ((--tries >= 0)); do
java -jar $FORGE_INSTALLER --installServer if java -jar "$FORGE_INSTALLER" --installServer; then
if [ $? == 0 ]; then
break break
fi fi
done done
if (($tries < 0)); then if ((tries < 0)); then
log "Forge failed to install after several tries." >&2 log "Forge failed to install after several tries." >&2
exit 10 exit 10
fi fi
@@ -66,7 +67,7 @@ install() {
export SERVER=$latest export SERVER=$latest
log "Using server $SERVER" log "Using server $SERVER"
echo $SERVER > $installMarker echo "$SERVER" > "$installMarker"
} }
resolve_versions() { resolve_versions() {
@@ -81,15 +82,21 @@ resolve_versions() {
esac esac
################################################################################# #################################################################################
promosUrl=http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
log "Checking Forge version information." log "Checking Forge version information."
case $FORGEVERSION in case $FORGEVERSION in
LATEST)
if ! FORGE_VERSION=$(get --json-path ".promos['$VANILLA_VERSION-latest']" "$promosUrl"); then
log "ERROR: Version $VANILLA_VERSION is not supported by Forge"
log " Refer to http://files.minecraftforge.net/ for supported versions"
exit 2
fi
;;
RECOMMENDED) RECOMMENDED)
curl -fsSL -o /tmp/forge.json http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json if ! FORGE_VERSION=$(get --json-path ".promos['$VANILLA_VERSION-recommended']" "$promosUrl"); then
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$VANILLA_VERSION-recommended\"]") if ! FORGE_VERSION=$(get --json-path ".promos['$VANILLA_VERSION-latest']" "$promosUrl"); then
if [ $FORGE_VERSION = null ]; then
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$VANILLA_VERSION-latest\"]")
if [ $FORGE_VERSION = null ]; then
log "ERROR: Version $VANILLA_VERSION is not supported by Forge" log "ERROR: Version $VANILLA_VERSION is not supported by Forge"
log " Refer to http://files.minecraftforge.net/ for supported versions" log " Refer to http://files.minecraftforge.net/ for supported versions"
exit 2 exit 2
@@ -122,14 +129,15 @@ resolve_versions
installMarker="/data/.forge-installed-$shortForgeVersion" installMarker="/data/.forge-installed-$shortForgeVersion"
if [ ! -e $installMarker ]; then if [ ! -e "$installMarker" ]; then
install install
else else
export SERVER=$(cat $installMarker) SERVER=$(cat "$installMarker")
export SERVER
if [ ! -e "$SERVER" ] && versionLessThan 1.17; then if [ ! -e "$SERVER" ] && versionLessThan 1.17; then
rm "$installMarker" rm "$installMarker"
install install
fi fi
fi fi
exec ${SCRIPTS:-/}start-setupWorld $@ exec "${SCRIPTS:-$(dirname "$0")}/start-setupWorld" "$@"
+8 -8
View File
@@ -1,17 +1,18 @@
#!/bin/bash #!/bin/bash
. ${SCRIPTS:-/}start-utils # shellcheck source=start-utils
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
set -o pipefail set -o pipefail
set -e set -e
isDebugging && set -x isDebugging && set -x
requireVar VANILLA_VERSION requireVar VANILLA_VERSION
: ${MOHIST_BUILD:=lastSuccessfulBuild} : "${MOHIST_BUILD:=lastSuccessfulBuild}"
mohistJobs=https://ci.codemc.io/job/MohistMC/job/ mohistJobs=https://ci.codemc.io/job/MohistMC/job/
mohistJob=${mohistJobs}Mohist-${VANILLA_VERSION}/ mohistJob=${mohistJobs}Mohist-${VANILLA_VERSION}/
if ! curl -X HEAD -o /dev/null -fsSL "${mohistJob}"; then if ! get --exists "${mohistJob}"; then
log "ERROR: mohist builds do not exist for ${VANILLA_VERSION}" log "ERROR: mohist builds do not exist for ${VANILLA_VERSION}"
log " check https://ci.codemc.io/job/MohistMC/ for available versions" log " check https://ci.codemc.io/job/MohistMC/ for available versions"
log " and set VERSION accordingly" log " and set VERSION accordingly"
@@ -19,8 +20,7 @@ if ! curl -X HEAD -o /dev/null -fsSL "${mohistJob}"; then
fi fi
buildRelPath=$( buildRelPath=$(
curl -fsSL "${mohistJob}${MOHIST_BUILD}/api/json" | get --json-path '$.artifacts[0].relativePath' "${mohistJob}${MOHIST_BUILD}/api/json"
jq -r '.artifacts[0].relativePath'
) )
baseName=$(basename "${buildRelPath}") baseName=$(basename "${buildRelPath}")
@@ -33,11 +33,11 @@ fi
export SERVER="/data/${baseName}" export SERVER="/data/${baseName}"
if [ ! -f ${SERVER} ]; then if [ ! -f "${SERVER}" ]; then
log "Downloading ${baseName}" log "Downloading ${baseName}"
curl -o "${SERVER}" -fsSL "${mohistJob}${MOHIST_BUILD}/artifact/${buildRelPath}" get -o "${SERVER}" "${mohistJob}${MOHIST_BUILD}/artifact/${buildRelPath}"
fi fi
export SKIP_LOG4J_CONFIG=true export SKIP_LOG4J_CONFIG=true
exec ${SCRIPTS:-/}start-setupWorld "$@" exec "${SCRIPTS:-$(dirname "$0")}/start-setupWorld" "$@"
+8 -25
View File
@@ -9,9 +9,7 @@ set -e -o pipefail
# shellcheck source=start-utils # shellcheck source=start-utils
. "${SCRIPTS:-$(dirname "$0")}/start-utils" . "${SCRIPTS:-$(dirname "$0")}/start-utils"
if isDebugging; then isDebugging && set -x
set -x
fi
# CURSE_URL_BASE used in manifest downloads below # CURSE_URL_BASE used in manifest downloads below
CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects} CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects}
@@ -25,25 +23,13 @@ fi
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack # If supplied with a URL for a modpack (simple zip of jars), download it and unpack
if [[ "$MODPACK" ]]; then if [[ "$MODPACK" ]]; then
if isURL "${MODPACK}"; then if isURL "${MODPACK}"; then
if [[ "${MODPACK}" == *.zip ]]; then
downloadUrl="${MODPACK}"
else
downloadUrl=$(curl -Ls -o /dev/null -w %{url_effective} $MODPACK)
if ! [[ $downloadUrl == *.zip ]]; then
log "ERROR Invalid URL given for MODPACK: $downloadUrl resolved from $MODPACK"
log " Must be HTTP, HTTPS or FTP and a ZIP file"
exit 1
fi
fi
log "Downloading mod/plugin pack" log "Downloading mod/plugin pack"
log " from $downloadUrl ..." if ! get -o /tmp/modpack.zip "${MODPACK}"; then
if ! curl -sSL -o /tmp/modpack.zip "$downloadUrl"; then log "ERROR: failed to download from ${MODPACK}"
log "ERROR: failed to download from $downloadUrl"
exit 2 exit 2
fi fi
elif [[ "$MODPACK" =~ .*\.zip ]]; then elif [[ "$MODPACK" =~ .*\.zip ]]; then
if ! cp $MODPACK /tmp/modpack.zip; then if ! cp "$MODPACK" /tmp/modpack.zip; then
log "ERROR: failed to copy from $MODPACK" log "ERROR: failed to copy from $MODPACK"
exit 2 exit 2
fi fi
@@ -55,19 +41,17 @@ if [[ "$MODPACK" ]]; then
if [ "$TYPE" = "SPIGOT" ]; then if [ "$TYPE" = "SPIGOT" ]; then
mkdir -p /data/plugins mkdir -p /data/plugins
if ! unzip -o -d /data/plugins /tmp/modpack.zip; then if ! unzip -o -d /data/plugins /tmp/modpack.zip; then
log "ERROR: failed to unzip the modpack from $downloadUrl" log "ERROR: failed to unzip the modpack from ${MODPACK}"
fi fi
else else
mkdir -p /data/mods mkdir -p /data/mods
if ! unzip -o -d /data/mods /tmp/modpack.zip; then if ! unzip -o -d /data/mods /tmp/modpack.zip; then
log "ERROR: failed to unzip the modpack from $downloadUrl" log "ERROR: failed to unzip the modpack from ${MODPACK}"
fi fi
fi fi
rm -f /tmp/modpack.zip rm -f /tmp/modpack.zip
fi
# If supplied with a URL for a plugin download it. elif [[ "$MODS" ]]; then
if [[ "$MODS" ]]; then
if [ "$TYPE" = "SPIGOT" ]; then if [ "$TYPE" = "SPIGOT" ]; then
out_dir=/data/plugins out_dir=/data/plugins
else else
@@ -98,9 +82,8 @@ if [[ "$MODS" ]]; then
exit 2 exit 2
fi fi
done done
fi
if [[ "$MODS_FILE" ]]; then elif [[ "$MODS_FILE" ]]; then
if [ ! -f "$MODS_FILE" ]; then if [ ! -f "$MODS_FILE" ]; then
log "ERROR: given MODS_FILE file does not exist" log "ERROR: given MODS_FILE file does not exist"
exit 2 exit 2