From 07185534fbf1bedd731ae183cc77a5cb2f587fb2 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 9 Aug 2020 13:28:36 -0500 Subject: [PATCH 01/27] Upgraded to mc-server-runner 1.5.0 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bfbd9a2a..ef7b5e41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,7 +55,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ - --var version=1.4.3 --var app=mc-server-runner --file {{.app}} \ + --var version=1.5.0 --var app=mc-server-runner --file {{.app}} \ --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ From 99ed83022ed55b5bb6ea18a283d75c1f2d6b157f Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 12 Aug 2020 20:47:52 -0500 Subject: [PATCH 02/27] misc: added EOL config to .editorconfig --- .editorconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 6583457a..c8fbb7e9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,2 +1,4 @@ [start-*] -indent_size = 2 \ No newline at end of file +indent_size = 2 +indent_style = space +end_of_line = lf From 8a5e5bf01e9f0e636c83558da0c09aaba28071fc Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 15 Aug 2020 10:02:45 -0500 Subject: [PATCH 03/27] Improved handling of missing Paper server version downloads Fixes #607 --- start-deployPaper | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/start-deployPaper b/start-deployPaper index 1bc5839e..870a8e0b 100644 --- a/start-deployPaper +++ b/start-deployPaper @@ -1,6 +1,7 @@ #!/bin/bash . ${SCRIPTS:-/}start-utils +set -o pipefail : ${PAPERBUILD:=latest} export SERVER=paper_server-${VANILLA_VERSION}-${PAPERBUILD}.jar @@ -11,8 +12,14 @@ fi downloadUrl=${PAPER_DOWNLOAD_URL:-https://papermc.io/api/v1/paper/${VANILLA_VERSION}/${PAPERBUILD}/download} log "Downloading Paper $VANILLA_VERSION (build $PAPERBUILD) from $downloadUrl ..." -if ! curl -fsSL -o "$SERVER" $zarg "$downloadUrl"; then - log "ERROR: failed to download from $downloadUrl (status=$?)" +if ! curl -fsSL -o "$SERVER" $zarg "$downloadUrl" 2> /dev/null; then + if versions=$(curl -fsSL https://papermc.io/api/v1/paper 2> /dev/null | jq -r '.versions | join(", ")'); then + log "ERROR: ${VANILLA_VERSION} is not (yet) published by PaperMC" + log " The following versions are available: " + log " ${versions}" + else + log "ERROR: failed to contact PaperMC at https://papermc.io/api/v1/paper" + fi exit 3 fi From 2322dffd49cd95e3736bb3a21b8770293dae87f7 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 15 Aug 2020 10:06:49 -0500 Subject: [PATCH 04/27] misc: Improved error log for missing Paper versions --- start-deployPaper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start-deployPaper b/start-deployPaper index 870a8e0b..0422eafc 100644 --- a/start-deployPaper +++ b/start-deployPaper @@ -15,7 +15,7 @@ log "Downloading Paper $VANILLA_VERSION (build $PAPERBUILD) from $downloadUrl .. if ! curl -fsSL -o "$SERVER" $zarg "$downloadUrl" 2> /dev/null; then if versions=$(curl -fsSL https://papermc.io/api/v1/paper 2> /dev/null | jq -r '.versions | join(", ")'); then log "ERROR: ${VANILLA_VERSION} is not (yet) published by PaperMC" - log " The following versions are available: " + log " Set VERSION to one of the following: " log " ${versions}" else log "ERROR: failed to contact PaperMC at https://papermc.io/api/v1/paper" From 48ccdf128f18061603eb48ce21ee1e59358e941d Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Tue, 18 Aug 2020 20:44:11 -0500 Subject: [PATCH 05/27] Fixed CF_SERVER_MOD to handle spaces in the given filename Updated USE_MODPACK_START_SCRIPT=false to support forge provided by pack For #608 --- start-deployCF | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/start-deployCF b/start-deployCF index 3af069a7..3c902953 100644 --- a/start-deployCF +++ b/start-deployCF @@ -3,6 +3,7 @@ set -e . ${SCRIPTS:-/}start-utils +isDebugging && set -x export FTB_BASE_DIR=/data/FeedTheBeast legacyJavaFixerUrl=http://ftb.cursecdn.com/FTB2/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar @@ -14,7 +15,7 @@ log "Looking for Feed-The-Beast / CurseForge server modpack." requireVar FTB_SERVER_MOD if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then - if ! [ -f ${FTB_SERVER_MOD} ]; then + if ! [ -f "${FTB_SERVER_MOD}" ]; then log "ERROR unable to find requested modpack file ${FTB_SERVER_MOD}" exit 2 fi @@ -37,22 +38,25 @@ if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then if $needsInstall; then log "Unpacking FTB server modpack ${FTB_SERVER_MOD} ..." mkdir -p ${FTB_BASE_DIR} - unzip -o ${FTB_SERVER_MOD} -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}' + unzip -o "${FTB_SERVER_MOD}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}' - forgeInstallerJar=$(find ${FTB_BASE_DIR} -name "forge*installer.jar") - if [[ -z "${forgeInstallerJar}" ]]; then - log "ERROR Unable to find forge installer in modpack." - log " Make sure you downloaded the server files." - exit 2 + serverJar=$(find ${FTB_BASE_DIR} -path "*/libraries/*" -prune -type f -o -not -name "forge*installer.jar" -name "forge*.jar") + if [[ -z "$serverJar" ]]; then + forgeInstallerJar=$(find ${FTB_BASE_DIR} -name "forge*installer.jar") + if [[ -z "${forgeInstallerJar}" ]]; then + log "ERROR Unable to find forge installer in modpack." + log " Make sure you downloaded the server files." + exit 2 + fi + + log "Installing forge server" + (cd $(dirname "${forgeInstallerJar}"); java -jar $(basename "${forgeInstallerJar}") --installServer) | awk '{printf "."} END {print ""}' fi - log "Installing forge server" - (cd $(dirname "${forgeInstallerJar}"); java -jar $(basename ${forgeInstallerJar}) --installServer) | awk '{printf "."} END {print ""}' - echo "${FTB_SERVER_MOD}" > $installMarker fi - export SERVER=$(find ${FTB_BASE_DIR} -not -name "forge*installer.jar" -name "forge*.jar") + export SERVER=$(find ${FTB_BASE_DIR} -path "*/libraries/*" -prune -type f -o -not -name "forge*installer.jar" -name "forge*.jar") if [[ -z "${SERVER}" || ! -f "${SERVER}" ]]; then log "ERROR unable to locate installed forge server jar" isDebugging && find ${FTB_BASE_DIR} -name "forge*.jar" @@ -89,7 +93,7 @@ fi # this allows saving just the world separate from the rest of the data directory if [[ $startScriptCount = 0 ]]; then srv_modpack=${FTB_SERVER_MOD} - if isURL ${srv_modpack}; then + if isURL "${srv_modpack}"; then case $srv_modpack in https://www.feed-the-beast.com/*/download|https://www.curseforge.com/minecraft/modpacks/*/download/*/file) ;; @@ -107,19 +111,19 @@ if [[ $startScriptCount = 0 ]]; then fi srv_modpack=$downloaded fi - if [[ ${srv_modpack:0:5} == "data/" ]]; then + if [[ "${srv_modpack:0:5}" == "data/" ]]; then # Prepend with "/" - srv_modpack=/${srv_modpack} + srv_modpack="/${srv_modpack}" fi - if [[ ! ${srv_modpack:0:1} == "/" ]]; then + if [[ ! "${srv_modpack:0:1}" == "/" ]]; then # If not an absolute path, assume file is in "/data" srv_modpack=/data/${srv_modpack} fi - if [[ ! -f ${srv_modpack} ]]; then + if [[ ! -f "${srv_modpack}" ]]; then log "FTB server modpack ${srv_modpack} not found." exit 2 fi - if [[ ! ${srv_modpack: -4} == ".zip" ]]; then + if [[ ! "${srv_modpack: -4}" == ".zip" ]]; then log "FTB server modpack ${srv_modpack} is not a zip archive." log "Please set FTB_SERVER_MOD to a file with a .zip extension." exit 2 @@ -127,7 +131,7 @@ if [[ $startScriptCount = 0 ]]; then log "Unpacking FTB server modpack ${srv_modpack} ..." mkdir -p ${FTB_BASE_DIR} - unzip -o ${srv_modpack} -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}' + unzip -o "${srv_modpack}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}' fi if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l) = 0 ]]; then @@ -165,7 +169,7 @@ export FTB_SERVER_START=$(find "${FTB_BASE_DIR}" $entryScriptExpr) export FTB_DIR=$(dirname "${FTB_SERVER_START}") chmod a+x "${FTB_SERVER_START}" -grep fml.queryResult=confirm ${FTB_SERVER_START} > /dev/null || \ +grep fml.queryResult=confirm "${FTB_SERVER_START}" > /dev/null || \ sed -i 's/-jar/-Dfml.queryResult=confirm -jar/' "${FTB_SERVER_START}" sed -i 's/.*read.*Restart now/#\0/' "${FTB_SERVER_START}" legacyJavaFixerPath="${FTB_DIR}/mods/legacyjavafixer.jar" From d78272c1fa696ab85758528a443e1acd1a29dad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Stefa=C5=84czyk?= Date: Sun, 23 Aug 2020 16:16:04 +0200 Subject: [PATCH 06/27] PaperSpigot is now known as Paper (#614) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a9b71349..3e87379f 100644 --- a/README.md +++ b/README.md @@ -421,9 +421,9 @@ You can build spigot from source by adding `-e BUILD_FROM_SOURCE=true` If you have attached a host directory to the `/data` volume, then you can install plugins within the `plugins` subdirectory. You can also [attach a `/plugins` volume](#deploying-plugins-from-attached-volume). If you add plugins while the container is running, you'll need to restart it to pick those up. -## Running a PaperSpigot server +## Running a Paper server -Enable PaperSpigot server mode by adding a `-e TYPE=PAPER` to your command-line. +Enable Paper server mode by adding a `-e TYPE=PAPER` to your command-line. By default the container will run the latest build of [Paper server](https://papermc.io/downloads) but you can also choose to run a specific build with `-e PAPERBUILD=205`. @@ -432,7 +432,7 @@ but you can also choose to run a specific build with `-e PAPERBUILD=205`. -e TYPE=PAPER \ -p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server -If you are hosting your own copy of PaperSpigot you can override the download URL with: +If you are hosting your own copy of Paper you can override the download URL with: - -e PAPER_DOWNLOAD_URL= From c8b6eac8fe50157afc7ea51cfa24b530f3741f05 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 23 Aug 2020 20:40:47 -0500 Subject: [PATCH 07/27] Updated FTBA modpack ID instructions Fixes #612 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3e87379f..0d30aa04 100644 --- a/README.md +++ b/README.md @@ -482,7 +482,7 @@ A [Catserver](http://catserver.moe/) type server can be used with [Feed the Beast application](https://www.feed-the-beast.com/) modpacks are supported by using `-e TYPE=FTBA` (**note** the "A" at the end of the type). This server type will automatically take care of downloading and installing the modpack and appropriate version of Forge, so the `VERSION` does not need to be specified. ### Environment Variables: -- `FTB_MODPACK_ID`: **required**, the numerical ID of the modpack to install. The ID can be located by finding the modpack at [Neptune FTB](https://ftb.neptunepowered.org/) and using the "Pack ID" +- `FTB_MODPACK_ID`: **required**, the numerical ID of the modpack to install. The ID can be located by [finding the modpack](https://www.feed-the-beast.com/modpack) and using the "ID" displayed next to the name - `FTB_MODPACK_VERSION_ID`: optional, the numerical Id of the version to install. If not specified, the latest version will be installed. The "Version ID" can be obtained by drilling into the Versions tab and clicking a specific version. ### Upgrading From 42f90c880657143e7d95a6b09883d7e977f7669e Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Tue, 25 Aug 2020 19:10:55 -0500 Subject: [PATCH 08/27] Added variable to configure stop duration Fixes #617 --- README.md | 4 ++++ start-minecraftFinalSetup | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d30aa04..3a9083f2 100644 --- a/README.md +++ b/README.md @@ -1104,6 +1104,10 @@ Some older versions (pre-1.14) of Spigot required `--noconsole` to be passed whe Some older servers get confused and think that the GUI interface is enabled. You can explicitly disable that by passing `-e GUI=FALSE`. +### Stop Duration + +When the container is signalled to stop, the Minecraft process wrapper will attempt to send a "stop" command via RCON or console and waits for the process to gracefully finish. By defaul it waits 60 seconds, but that duration can be configured by setting the environment variable `STOP_DURATION` to the number of seconds. + ## Running on RaspberryPi To run this image on a RaspberryPi 3 B+, 4, or newer, use the image tag diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index 21b933cf..c2377d3a 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -173,7 +173,7 @@ function copyFilesForCurseForge() { cp -f /data/eula.txt "${FTB_DIR}/" } -mcServerRunnerArgs="--stop-duration 60s" +mcServerRunnerArgs="--stop-duration ${STOP_DURATION:-60}s" if [[ ${TYPE} == "CURSE_INSTANCE" ]]; then if isTrue ${DEBUG_EXEC}; then set -x From 9ea675bc8913bf275e7c01173c26f02bc5ddc7ed Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Tue, 25 Aug 2020 21:44:36 -0500 Subject: [PATCH 09/27] Improved handling of latest PaperMC version Fixes #563 --- start-deployPaper | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/start-deployPaper b/start-deployPaper index 0422eafc..6a84a51c 100644 --- a/start-deployPaper +++ b/start-deployPaper @@ -12,16 +12,32 @@ fi downloadUrl=${PAPER_DOWNLOAD_URL:-https://papermc.io/api/v1/paper/${VANILLA_VERSION}/${PAPERBUILD}/download} log "Downloading Paper $VANILLA_VERSION (build $PAPERBUILD) from $downloadUrl ..." -if ! curl -fsSL -o "$SERVER" $zarg "$downloadUrl" 2> /dev/null; then - if versions=$(curl -fsSL https://papermc.io/api/v1/paper 2> /dev/null | jq -r '.versions | join(", ")'); then - log "ERROR: ${VANILLA_VERSION} is not (yet) published by PaperMC" - log " Set VERSION to one of the following: " - log " ${versions}" - else - log "ERROR: failed to contact PaperMC at https://papermc.io/api/v1/paper" - fi - exit 3 -fi +out=$(curl -fsSL -o "$SERVER" $zarg "$downloadUrl" 2>&1) +case $? in + 0) + ;; + 22) # = 404 HTTP status + if versions=$(curl -fsSL https://papermc.io/api/v1/paper 2> /dev/null); then + if [[ $VERSION = LATEST ]]; then + VANILLA_VERSION=$(echo $versions | jq -r '.versions[0]') + log "WARN: using ${VANILLA_VERSION} since that's the latest provided by PaperMC" + # re-execute the current script with the newly computed version + exec $0 "$@" + fi + log "ERROR: ${VANILLA_VERSION} is not (yet) published by PaperMC" + log " Set VERSION to one of the following: " + log " $(echo $versions | jq -r '.versions | join(", ")')" + else + log "ERROR: failed to retrieve versions from https://papermc.io/api/v1/paper" + fi + exit 3 + ;; + *) + log "ERROR: failed to contact PaperMC at $downloadUrl" + log " $out" + exit 3 + ;; +esac # Normalize on Spigot for downstream operations export TYPE=SPIGOT From 6cfc7e45efdea0b5b03ecaebb017b66d9a42ac2b Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 27 Aug 2020 18:49:24 -0500 Subject: [PATCH 10/27] ci: prepared for adopt14 variant --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9e436904..93c06f1e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,12 +8,14 @@ on: - openj9-nightly - adopt11 - adopt13 + - adopt14 tags: - "[0-9]+.[0-9]+.[0-9]+" - "[0-9]+.[0-9]+.[0-9]+-openj9" - "[0-9]+.[0-9]+.[0-9]+-openj9-nightly" - "[0-9]+.[0-9]+.[0-9]+-adopt11" - "[0-9]+.[0-9]+.[0-9]+-adopt13" + - "[0-9]+.[0-9]+.[0-9]+-adopt14" jobs: test: From 0ddabf3089f561acf159ad63ecaef041d6b3c2db Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 10 Sep 2020 16:25:29 -0500 Subject: [PATCH 11/27] Corrected Fabric installer variables in README --- README.md | 34 ++++++++++++++++++---------------- start-deployFabric | 24 +++++++++++------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 3a9083f2..799e177f 100644 --- a/README.md +++ b/README.md @@ -557,29 +557,31 @@ Just change it with `SPONGEBRANCH`, such as: ## Running a Fabric Server -Enable Fabric server mode by adding a `-e TYPE=FABRIC` to your command-line. -By default the container will run the latest version of [Fabric server](http://fabricmc.net/use/) -but you can also choose to run a specific version with `-e FABRICVERSION=0.5.0.32`. +Enable [Fabric server](http://fabricmc.net/use/) mode by adding a `-e TYPE=FABRIC` to your command-line. By default, the container will run the latest version, but you can also choose to run a specific version with `VERSION`. - $ docker run -d -v /path/on/host:/data \ - -e TYPE=FABRIC -e FABRICVERSION=0.5.0.32 \ - -p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server +``` +docker run -d -v /path/on/host:/data \ + -e TYPE=FABRIC \ + -p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server +``` -To use a pre-downloaded Fabric installer, place it in the attached `/data` directory and -specify the name of the installer file with `FABRIC_INSTALLER`, such as: +A specific installer version can be requested using `FABRIC_INSTALLER_VERSION`. - $ docker run -d -v /path/on/host:/data ... \ - -e FABRIC_INSTALLER=fabric-installer-0.5.0.32.jar ... +To use a pre-downloaded Fabric installer, place it in a directory attached into the container, such as the `/data` volume and specify the name of the installer file with `FABRIC_INSTALLER`, such as: -To download a Fabric installer from a custom location, such as your own file repository, specify -the URL with `FABRIC_INSTALLER_URL`, such as: +``` +docker run -d -v /path/on/host:/data ... \ + -e FABRIC_INSTALLER=fabric-installer-0.5.0.32.jar ... +``` - $ docker run -d -v /path/on/host:/data ... \ - -e FORGE_INSTALLER_URL=http://HOST/fabric-installer-0.5.0.32.jar ... +To download a Fabric installer from a custom location, such as your own file repository, specify the URL with `FABRIC_INSTALLER_URL`, such as: -In both of the cases above, there is no need for the `VERSION` or `FABRICVERSION` variables. +``` +docker run -d -v /path/on/host:/data ... \ + -e FABRIC_INSTALLER_URL=http://HOST/fabric-installer-0.5.0.32.jar ... +``` -In order to add mods, you have two options. +In order to add mods, you have two options: ### Using the /data volume diff --git a/start-deployFabric b/start-deployFabric index 0c748455..e933b6f7 100644 --- a/start-deployFabric +++ b/start-deployFabric @@ -7,36 +7,34 @@ export TYPE=FABRIC FABRIC_INSTALLER=${FABRIC_INSTALLER:-} FABRIC_INSTALLER_URL=${FABRIC_INSTALLER_URL:-} -FABRICVERSION=${FABRICVERSION:-LATEST} +FABRIC_INSTALLER_VERSION=${FABRIC_INSTALLER_VERSION:-${FABRICVERSION:-LATEST}} if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then log "Checking Fabric version information." - case $FABRICVERSION in + case $FABRIC_INSTALLER_VERSION in LATEST) - FABRIC_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml) - ;; - - *) - FABRIC_VERSION=$FABRICVERSION + FABRIC_INSTALLER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml) ;; esac - FABRIC_INSTALLER="/tmp/fabric-installer-$FABRIC_VERSION.jar" + FABRIC_INSTALLER="/tmp/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar" + markerVersion=$FABRIC_INSTALLER_VERSION elif [[ -z $FABRIC_INSTALLER ]]; then FABRIC_INSTALLER="/tmp/fabric-installer.jar" + markerVersion=custom elif [[ ! -e $FABRIC_INSTALLER ]]; then log "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER" exit 2 fi -installMarker="/data/.fabric-installed-${VANILLA_VERSION}-${FABRIC_VERSION:-manual}" +installMarker="/data/.fabric-installed-${VANILLA_VERSION}-${markerVersion}" debug Checking for installMarker ${installMarker} if [[ ! -e $installMarker ]]; then if [[ ! -e $FABRIC_INSTALLER ]]; then if [[ -z $FABRIC_INSTALLER_URL ]]; then - log "Downloading $FABRIC_VERSION" - downloadUrl="https://maven.fabricmc.net/net/fabricmc/fabric-installer/$FABRIC_VERSION/fabric-installer-$FABRIC_VERSION.jar" + log "Downloading installer version $FABRIC_INSTALLER_VERSION" + downloadUrl="https://maven.fabricmc.net/net/fabricmc/fabric-installer/${FABRIC_INSTALLER_VERSION}/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar" log "...trying $downloadUrl" curl -o $FABRIC_INSTALLER -fsSL $downloadUrl else @@ -49,9 +47,9 @@ if [[ ! -e $installMarker ]]; then fi if isDebugging; then - debug "Installing Fabric $FABRIC_VERSION using $FABRIC_INSTALLER with mcversion ${VANILLA_VERSION}" + debug "Installing Fabric ${VANILLA_VERSION} using $FABRIC_INSTALLER" else - log "Installing Fabric $FABRIC_VERSION using $FABRIC_INSTALLER" + log "Installing Fabric using $FABRIC_INSTALLER" fi tries=3 set +e From 7c3139226c6c631b0d3e113ad32f2d3e2c653f81 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 16 Sep 2020 17:09:16 -0500 Subject: [PATCH 12/27] Changed Paper update process to check FORCE_REDOWNLOAD first For #634 --- start-deployPaper | 64 +++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/start-deployPaper b/start-deployPaper index 6a84a51c..ebe6c958 100644 --- a/start-deployPaper +++ b/start-deployPaper @@ -2,42 +2,46 @@ . ${SCRIPTS:-/}start-utils set -o pipefail +isDebugging && set -x : ${PAPERBUILD:=latest} export SERVER=paper_server-${VANILLA_VERSION}-${PAPERBUILD}.jar -if [ -f "$SERVER" ] && ! isTrue "$FORCE_REDOWNLOAD"; then - zarg="-z '$SERVER'" -fi +if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then -downloadUrl=${PAPER_DOWNLOAD_URL:-https://papermc.io/api/v1/paper/${VANILLA_VERSION}/${PAPERBUILD}/download} -log "Downloading Paper $VANILLA_VERSION (build $PAPERBUILD) from $downloadUrl ..." -out=$(curl -fsSL -o "$SERVER" $zarg "$downloadUrl" 2>&1) -case $? in - 0) - ;; - 22) # = 404 HTTP status - if versions=$(curl -fsSL https://papermc.io/api/v1/paper 2> /dev/null); then - if [[ $VERSION = LATEST ]]; then - VANILLA_VERSION=$(echo $versions | jq -r '.versions[0]') - log "WARN: using ${VANILLA_VERSION} since that's the latest provided by PaperMC" - # re-execute the current script with the newly computed version - exec $0 "$@" + if [ -f "$SERVER" ]; then + zarg=(-z "$SERVER") + fi + + downloadUrl=${PAPER_DOWNLOAD_URL:-https://papermc.io/api/v1/paper/${VANILLA_VERSION}/${PAPERBUILD}/download} + log "Downloading Paper $VANILLA_VERSION (build $PAPERBUILD) from $downloadUrl ..." + out=$(curl -fsSL -o "$SERVER" "${zarg[@]}" "$downloadUrl" 2>&1) + case $? in + 0) + ;; + 22) # = 404 HTTP status + if versions=$(curl -fsSL https://papermc.io/api/v1/paper 2> /dev/null); then + if [[ $VERSION = LATEST ]]; then + VANILLA_VERSION=$(echo $versions | jq -r '.versions[0]') + log "WARN: using ${VANILLA_VERSION} since that's the latest provided by PaperMC" + # re-execute the current script with the newly computed version + exec $0 "$@" + fi + log "ERROR: ${VANILLA_VERSION} is not (yet) published by PaperMC" + log " Set VERSION to one of the following: " + log " $(echo $versions | jq -r '.versions | join(", ")')" + else + log "ERROR: failed to retrieve versions from https://papermc.io/api/v1/paper" fi - log "ERROR: ${VANILLA_VERSION} is not (yet) published by PaperMC" - log " Set VERSION to one of the following: " - log " $(echo $versions | jq -r '.versions | join(", ")')" - else - log "ERROR: failed to retrieve versions from https://papermc.io/api/v1/paper" - fi - exit 3 - ;; - *) - log "ERROR: failed to contact PaperMC at $downloadUrl" - log " $out" - exit 3 - ;; -esac + exit 3 + ;; + *) + log "ERROR: failed to contact PaperMC at $downloadUrl" + log " $out" + exit 3 + ;; + esac +fi # Normalize on Spigot for downstream operations export TYPE=SPIGOT From 8b977f87863dba3730c10ca593c6ae4dd1bd1725 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 27 Aug 2020 18:57:47 -0500 Subject: [PATCH 13/27] Added adopt14 variant --- README.md | 1 + docker-versions-create.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 799e177f..78bc997b 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,7 @@ To use a different version of Java, please use a docker tag to run your Minecraf | Tag name | Description | Linux | | -------------- | ------------------------------------------- | ------------ | | latest | **Default**. Uses Java version 8 update 212 | Alpine Linux | +| adopt14 | Uses Java version 14 latest update | Alpine Linux | | adopt13 | Uses Java version 13 latest update | Alpine Linux | | adopt11 | Uses Java version 11 latest update | Alpine Linux | | openj9 | Uses Eclipse OpenJ9 JVM | Alpine Linux | diff --git a/docker-versions-create.sh b/docker-versions-create.sh index 8ed98c54..23a5ebae 100755 --- a/docker-versions-create.sh +++ b/docker-versions-create.sh @@ -1,7 +1,7 @@ #!/bin/bash #set -x # Use this variable to indicate a list of branches that docker hub is watching -branches_list=('openj9' 'openj9-nightly' 'adopt11' 'adopt13' 'multiarch') +branches_list=('openj9' 'openj9-nightly' 'adopt11' 'adopt13' 'adopt14' 'multiarch') function TrapExit { echo "Checking out back in master" From 777ad31de0d084dc04933f0469b4ceaadcd2c001 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 27 Sep 2020 10:21:33 -0500 Subject: [PATCH 14/27] Resolve latest bukkit/spigot directly from getbukkit Fixes #629 #631 --- start-deployBukkitSpigot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/start-deployBukkitSpigot b/start-deployBukkitSpigot index cb2309e5..96a262e2 100644 --- a/start-deployBukkitSpigot +++ b/start-deployBukkitSpigot @@ -58,6 +58,10 @@ 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]') + fi + if [[ -z $downloadUrl ]]; then downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar" fi From b06f1115d4e93af93c539209d0ba4487fa2e39bd Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 27 Sep 2020 10:27:46 -0500 Subject: [PATCH 15/27] Added pruning of 'config' to CF modpack upgrade Fixes #626 --- start-deployCF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start-deployCF b/start-deployCF index 3c902953..e81b5e59 100644 --- a/start-deployCF +++ b/start-deployCF @@ -28,7 +28,7 @@ if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then serverJar=$(find ${FTB_BASE_DIR} -not -name "forge*installer.jar" -name "forge*.jar") if [[ "${serverJar}" ]]; then - rm -rf $(dirname "${serverJar}")/{mods,*.jar,libraries,resources,scripts} + rm -rf $(dirname "${serverJar}")/{mods,*.jar,libraries,resources,scripts,config} fi else needsInstall=false From 6f1f8d7806c72f45e4b5f36319565ee396a6e9dd Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 3 Oct 2020 14:34:02 -0500 Subject: [PATCH 16/27] Added use of REMOVE_OLD_MODS to /mods processing --- README.md | 2 +- start-minecraftFinalSetup | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78bc997b..1ef13abf 100644 --- a/README.md +++ b/README.md @@ -297,7 +297,7 @@ or downloading a world with the `WORLD` option. There are two additional volumes that can be mounted; `/mods` and `/config`. Any files in either of these filesystems will be copied over to the main -`/data` filesystem before starting Minecraft. +`/data` filesystem before starting Minecraft. If you want old mods to be removed as the `/mods` content is updated, then add `-e REMOVE_OLD_MODS=TRUE`. This works well if you want to have a common set of modules in a separate location, but still have multiple worlds with different server requirements diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index c2377d3a..c19a2a13 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -54,7 +54,10 @@ done if [ -d /mods ]; then log "Copying any mods over..." mkdir -p /data/mods - rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /mods /data + if isTrue "${REMOVE_OLD_MODS}"; then + rsyncArgs=(--delete) + fi + rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /mods /data fi [ -d /data/config ] || mkdir /data/config From 3cb72797b6abdd72e08e0c5429847dbea23c87ee Mon Sep 17 00:00:00 2001 From: vatertime Date: Wed, 7 Oct 2020 13:35:07 -0500 Subject: [PATCH 17/27] Added AWS blurb to readme (#644) * Added AWS blurb to readme * moved section in readme Co-authored-by: Chris Vater --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ef13abf..9420e52c 100644 --- a/README.md +++ b/README.md @@ -227,6 +227,10 @@ describes period of the daemonized state machine, that handles the pausing of th The [examples directory](https://github.com/itzg/docker-minecraft-server/tree/master/examples) also provides examples of deploying the [itzg/minecraft-server](https://hub.docker.com/r/itzg/minecraft-server/) Docker image. +### Amazon Web Services (AWS) Deployment + +If you're looking for a simple way to deploy this to the Amazon Web Services Cloud, check out the [Minecraft Server Deployment (CloudFormation) repository](https://github.com/vatertime/minecraft-spot-pricing). This repository contains a CloudFormation template that will get you up and running in AWS in a matter of minutes. Optionally it uses Spot Pricing so the server is very cheap, and you can easily turn it off when not in use. + ## Running a Forge Server Enable Forge server mode by adding a `-e TYPE=FORGE` to your command-line. @@ -1117,4 +1121,4 @@ To run this image on a RaspberryPi 3 B+, 4, or newer, use the image tag itzg/minecraft-server:multiarch -> NOTE: you may need to lower the memory allocation, such as `-e MEMORY=750m` +> NOTE: you may need to lower the memory allocation, such as `-e MEMORY=750m` \ No newline at end of file From b7ac28e902101b0607004a6f8862c932829a1d43 Mon Sep 17 00:00:00 2001 From: Paul1365972 Date: Sun, 11 Oct 2020 20:27:59 +0200 Subject: [PATCH 18/27] IPv6 support for autopause (#646) --- files/autopause/autopause-fcns.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/autopause/autopause-fcns.sh b/files/autopause/autopause-fcns.sh index aea37a6f..5ebae93c 100644 --- a/files/autopause/autopause-fcns.sh +++ b/files/autopause/autopause-fcns.sh @@ -13,7 +13,7 @@ rcon_client_exists() { } mc_server_listening() { - [[ -n $(netstat -tln | grep "0.0.0.0:$SERVER_PORT" | grep LISTEN) ]] + [[ -n $(netstat -tln | grep -e "0.0.0.0:$SERVER_PORT" -e ":::$SERVER_PORT" | grep LISTEN) ]] } java_clients_connected() { @@ -29,7 +29,7 @@ java_clients_connected() { # remember, that the host network mode does not work with autopause because of the knockd utility for (( i=0; i<${#connections[@]}; i++ )) do - if [[ ! $(echo "${connections[$i]}" | awk '{print $5}') =~ ^\s*127\.0\.0\.1:.*$ ]] ; then + if [[ ! $(echo "${connections[$i]}" | awk '{print $5}') =~ ^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*\:)*?:?0*1$ ]] ; then # not localhost return 0 fi From ed1bb73c221db86aaec8320cd9e3d8ea86cfd2b0 Mon Sep 17 00:00:00 2001 From: stevoh6 Date: Thu, 15 Oct 2020 04:21:40 +0200 Subject: [PATCH 19/27] Update deprecated LegacyJavaFixer path. (#648) --- start-deployCF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start-deployCF b/start-deployCF index e81b5e59..97e4e54f 100644 --- a/start-deployCF +++ b/start-deployCF @@ -6,7 +6,7 @@ set -e isDebugging && set -x export FTB_BASE_DIR=/data/FeedTheBeast -legacyJavaFixerUrl=http://ftb.cursecdn.com/FTB2/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar +legacyJavaFixerUrl=https://ftb.forgecdn.net/FTB2/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar export TYPE=FEED-THE-BEAST FTB_SERVER_MOD=${FTB_SERVER_MOD:-$CF_SERVER_MOD} From 31b8535854adaaea68eab5b9b2b0e79515b0651e Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 30 Oct 2020 17:03:13 -0500 Subject: [PATCH 20/27] Added debug output for bukkit/sigot type For #655 --- start-deployBukkitSpigot | 1 + 1 file changed, 1 insertion(+) diff --git a/start-deployBukkitSpigot b/start-deployBukkitSpigot index 96a262e2..bad714d6 100644 --- a/start-deployBukkitSpigot +++ b/start-deployBukkitSpigot @@ -1,6 +1,7 @@ #!/bin/bash . ${SCRIPTS:-/}start-utils +isDebugging && set -x set -e From e56a74dc81bc390cfccb4e06d7f28a1565d42366 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 2 Nov 2020 20:31:01 -0600 Subject: [PATCH 21/27] Improved handling of bad spigot/bukkit downloads via temp file For #655 --- start-deployBukkitSpigot | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/start-deployBukkitSpigot b/start-deployBukkitSpigot index bad714d6..77e8d24b 100644 --- a/start-deployBukkitSpigot +++ b/start-deployBukkitSpigot @@ -72,8 +72,9 @@ function downloadSpigot { zarg="-z $SERVER" fi log "Downloading $match from $downloadUrl ..." - curl -fsSL -o $SERVER $zarg "$downloadUrl" - if [[ $? != 0 || $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then + tmpJar=/tmp/${getbukkitFlavor}.jar + curl -fsSL -o "$tmpJar" $zarg "$downloadUrl" + if [[ $? != 0 || $(grep -c "DOCTYPE html" $tmpJar) != 0 ]]; then cat < Date: Tue, 3 Nov 2020 16:47:46 -0600 Subject: [PATCH 22/27] Revert "Improved handling of bad spigot/bukkit downloads via temp file For #655" This reverts commit e56a74dc --- start-deployBukkitSpigot | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/start-deployBukkitSpigot b/start-deployBukkitSpigot index 77e8d24b..bad714d6 100644 --- a/start-deployBukkitSpigot +++ b/start-deployBukkitSpigot @@ -72,9 +72,8 @@ function downloadSpigot { zarg="-z $SERVER" fi log "Downloading $match from $downloadUrl ..." - tmpJar=/tmp/${getbukkitFlavor}.jar - curl -fsSL -o "$tmpJar" $zarg "$downloadUrl" - if [[ $? != 0 || $(grep -c "DOCTYPE html" $tmpJar) != 0 ]]; then + curl -fsSL -o $SERVER $zarg "$downloadUrl" + if [[ $? != 0 || $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then cat < Date: Tue, 3 Nov 2020 16:49:38 -0600 Subject: [PATCH 23/27] Added debug logging of bukkit/spigot curl download For #655 --- start-deployBukkitSpigot | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/start-deployBukkitSpigot b/start-deployBukkitSpigot index bad714d6..443f6426 100644 --- a/start-deployBukkitSpigot +++ b/start-deployBukkitSpigot @@ -67,12 +67,16 @@ function downloadSpigot { downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar" fi + setServerVar if [ -f $SERVER ]; then # tell curl to only download when newer - zarg="-z $SERVER" + curlArgs="-z $SERVER" + fi + if isDebugging; then + curlArgs="$curlArgs -v" fi log "Downloading $match from $downloadUrl ..." - curl -fsSL -o $SERVER $zarg "$downloadUrl" + curl -fsSL -o $SERVER $curlArgs "$downloadUrl" if [[ $? != 0 || $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then cat < Date: Wed, 4 Nov 2020 17:04:57 -0600 Subject: [PATCH 24/27] Removed invalid spigot/bukkit download along with debug of content For #655 --- start-deployBukkitSpigot | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/start-deployBukkitSpigot b/start-deployBukkitSpigot index 443f6426..37b59269 100644 --- a/start-deployBukkitSpigot +++ b/start-deployBukkitSpigot @@ -85,6 +85,13 @@ ERROR: failed to download from $downloadUrl exact version, such as 1.4.6-R0.4-SNAPSHOT or 1.8-R0.1-SNAPSHOT-LATEST EOF + + if isDebugging && [[ $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then + cat $SERVER + fi + + # remove invalid download + rm $SERVER exit 3 fi From f68e979229469f070a91155985f07439294b0649 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 6 Nov 2020 14:47:04 -0600 Subject: [PATCH 25/27] docs: Improved appearance of Discord badge For #481 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9420e52c..0aa245fa 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![Docker Pulls](https://img.shields.io/docker/pulls/itzg/minecraft-server.svg)](https://hub.docker.com/r/itzg/minecraft-server/) [![Docker Stars](https://img.shields.io/docker/stars/itzg/minecraft-server.svg?maxAge=2592000)](https://hub.docker.com/r/itzg/minecraft-server/) [![GitHub Issues](https://img.shields.io/github/issues-raw/itzg/docker-minecraft-server.svg)](https://github.com/itzg/docker-minecraft-server/issues) -[![Discord](https://img.shields.io/discord/660567679458869252)](https://discord.gg/DXfKpjB) +[![Discord](https://img.shields.io/discord/660567679458869252?label=Discord&logo=discord)](https://discord.gg/DXfKpjB) [![Build and Publish](https://github.com/itzg/docker-minecraft-server/workflows/Build%20and%20Publish/badge.svg)](https://github.com/itzg/docker-minecraft-server/actions) [![](https://img.shields.io/badge/Donate-Buy%20me%20a%20coffee-orange.svg)](https://www.buymeacoffee.com/itzg) From 08a4bde6c1a004918f15ae825f0c72adbcde9462 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 25 Nov 2020 15:42:27 -0600 Subject: [PATCH 26/27] Switched to PaperMC v2 API Fixes #670 --- start-deployPaper | 79 +++++++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 34 deletions(-) diff --git a/start-deployPaper b/start-deployPaper index ebe6c958..16e80edb 100644 --- a/start-deployPaper +++ b/start-deployPaper @@ -4,43 +4,54 @@ set -o pipefail isDebugging && set -x -: ${PAPERBUILD:=latest} -export SERVER=paper_server-${VANILLA_VERSION}-${PAPERBUILD}.jar +# PaperMC API v2 docs : https://papermc.io/api/docs/swagger-ui/index.html?configUrl=/api/openapi/swagger-config -if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then +build=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}" -H "accept: application/json" \ + | jq '.builds[-1]') +case $? in + 0) + ;; + 22) + versions=$(curl -fsSL "https://papermc.io/api/v2/projects/paper" -H "accept: application/json") + if [[ $VERSION = LATEST ]]; then + VANILLA_VERSION=$(echo "$versions" | jq -r '.versions[-1]') + log "WARN: using ${VANILLA_VERSION} since that's the latest provided by PaperMC" + # re-execute the current script with the newly computed version + exec $0 "$@" + fi + log "ERROR: ${VANILLA_VERSION} is not published by PaperMC" + log " Set VERSION to one of the following: " + log " $(echo "$versions" | jq -r '.versions | join(", ")')" + exit 1 + ;; + *) + echo "ERROR: unknown error while looking up PaperMC version=${VANILLA_VERSION}" + exit 1 + ;; +esac +if [ $? != 0 ]; then + echo "ERROR: failed to lookup PaperMC build from version ${VANILLA_VERSION}" + exit 1 +fi - if [ -f "$SERVER" ]; then - zarg=(-z "$SERVER") - fi +export SERVER=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}" -H "accept: application/json" \ + | jq -r '.downloads.application.name') +if [ $? != 0 ]; then + echo "ERROR: failed to lookup PaperMC download file from version=${VANILLA_VERSION} build=${build}" + exit 1 +fi - downloadUrl=${PAPER_DOWNLOAD_URL:-https://papermc.io/api/v1/paper/${VANILLA_VERSION}/${PAPERBUILD}/download} - log "Downloading Paper $VANILLA_VERSION (build $PAPERBUILD) from $downloadUrl ..." - out=$(curl -fsSL -o "$SERVER" "${zarg[@]}" "$downloadUrl" 2>&1) - case $? in - 0) - ;; - 22) # = 404 HTTP status - if versions=$(curl -fsSL https://papermc.io/api/v1/paper 2> /dev/null); then - if [[ $VERSION = LATEST ]]; then - VANILLA_VERSION=$(echo $versions | jq -r '.versions[0]') - log "WARN: using ${VANILLA_VERSION} since that's the latest provided by PaperMC" - # re-execute the current script with the newly computed version - exec $0 "$@" - fi - log "ERROR: ${VANILLA_VERSION} is not (yet) published by PaperMC" - log " Set VERSION to one of the following: " - log " $(echo $versions | jq -r '.versions | join(", ")')" - else - log "ERROR: failed to retrieve versions from https://papermc.io/api/v1/paper" - fi - exit 3 - ;; - *) - log "ERROR: failed to contact PaperMC at $downloadUrl" - log " $out" - exit 3 - ;; - esac +if [ -f "$SERVER" ]; then + zarg=(-z "$SERVER") +fi + +log "Downloading PaperMC $VANILLA_VERSION (build $build) ..." +curl -fsSL -o "$SERVER" "${zarg[@]}" \ + "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}/downloads/${SERVER}" \ + -H "accept: application/java-archive" +if [ $? != 0 ]; then + echo "ERROR: failed to download PaperMC from version=${VANILLA_VERSION} build=${build} download=${SERVER}" + exit 1 fi # Normalize on Spigot for downstream operations From a368f4cf573b6069030c1b55aa633977cc4303d3 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Wed, 25 Nov 2020 15:52:07 -0600 Subject: [PATCH 27/27] misc: Added multiarch-latest to versions to release --- docker-versions-create.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-versions-create.sh b/docker-versions-create.sh index 23a5ebae..b9a4c0a9 100755 --- a/docker-versions-create.sh +++ b/docker-versions-create.sh @@ -1,7 +1,7 @@ #!/bin/bash #set -x # Use this variable to indicate a list of branches that docker hub is watching -branches_list=('openj9' 'openj9-nightly' 'adopt11' 'adopt13' 'adopt14' 'multiarch') +branches_list=('openj9' 'openj9-nightly' 'adopt11' 'adopt13' 'adopt14' 'multiarch' 'multiarch-latest') function TrapExit { echo "Checking out back in master"