mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-07-12 19:45:10 +00:00
added variables for pufferfish, also added setup only test (#1399)
This commit is contained in:
@@ -539,10 +539,10 @@ A [Pufferfish](https://github.com/pufferfish-gg/Pufferfish) server, which is "a
|
|||||||
|
|
||||||
-e TYPE=PUFFERFISH
|
-e TYPE=PUFFERFISH
|
||||||
|
|
||||||
> NOTE: The `VERSION` variable is used to select a Pufferfish branch to download from. The available options are "LATEST" and "1.18"
|
> NOTE: The `VERSION` variable is used to select branch latest, 1.18, or 1.17. Use PUFFERFISH_BUILD to really select the SERVER VERSION number.
|
||||||
|
|
||||||
Extra variables:
|
Extra variables:
|
||||||
- `PUFFERFISH_BUILD=lastSuccessfulBuild` : set a specific Pufferfish build to use
|
- `PUFFERFISH_BUILD=lastSuccessfulBuild` : set a specific Pufferfish build to use. Example: selecting build 47 => 1.18.1, or build 50 => 1.18.2 etc
|
||||||
- `FORCE_REDOWNLOAD=false` : set to true to force the located server jar to be re-downloaded
|
- `FORCE_REDOWNLOAD=false` : set to true to force the located server jar to be re-downloaded
|
||||||
- `USE_FLARE_FLAGS=false` : set to true to add appropriate flags for the built-in [Flare](https://blog.airplane.gg/flare) profiler
|
- `USE_FLARE_FLAGS=false` : set to true to add appropriate flags for the built-in [Flare](https://blog.airplane.gg/flare) profiler
|
||||||
|
|
||||||
|
|||||||
@@ -1,39 +1,40 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
# shellcheck source=start-utils
|
||||||
|
. "${SCRIPTS:-/}start-utils"
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
isDebugging && set -x
|
isDebugging && set -x
|
||||||
|
|
||||||
IFS=$'\n\t'
|
IFS=$'\n\t'
|
||||||
|
|
||||||
if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "1.18" ] ; then
|
if [ "${VANILLA_VERSION%.*}" != "1.18" ] && [ "${VANILLA_VERSION%.*}" != "1.17" ]; then
|
||||||
log "ERROR: Pufferfish server type only supports VERSION=LATEST, VERSION=1.18. Note that these are branches, not #.#.# versions."
|
log "ERROR: Pufferfish server type only supports versions 1.18 or 1.17, use PUFFERFISH_BUILD to select the the correct build 47 => 1.18.1, 50 => 1.18.2 etc"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
: ${PUFFERFISH_BUILD:=lastSuccessfulBuild}
|
: "${PUFFERFISH_BUILD:=lastSuccessfulBuild}"
|
||||||
|
|
||||||
if [ "${VERSION}" = "LATEST" ] || [ "${VERSION}" = "1.18" ]; then
|
PUFFERFISH_BUILD_JSON=$(curl -X GET -s "https://ci.pufferfish.host/job/Pufferfish-${VANILLA_VERSION%.*}/${PUFFERFISH_BUILD}/api/json")
|
||||||
PUFFERFISH_BRANCH="1.18"
|
# Example: "url": "https://ci.pufferfish.host/job/Pufferfish-1.18/50/",
|
||||||
PUFFERFISH_VERSION="1.18.1-R0.1"
|
PUFFERFISH_BUILD_URL=$(jq -n "$PUFFERFISH_BUILD_JSON" | jq -jc '.url // empty' )
|
||||||
fi
|
# Example: "fileName": "pufferfish-paperclip-1.18.2-R0.1-SNAPSHOT-reobf.jar",
|
||||||
|
PUFFERFISH_BUILD_FILENAME=$(jq -n "$PUFFERFISH_BUILD_JSON" | jq -jc '.artifacts[].fileName // empty' )
|
||||||
|
PUFFERFISH_BUILD_DOWNLOAD_URL="${PUFFERFISH_BUILD_URL}artifact/build/libs/${PUFFERFISH_BUILD_FILENAME}"
|
||||||
|
|
||||||
log "Using Pufferfish-${PUFFERFISH_BRANCH} branch"
|
# Setting server to the Jar filename for export.
|
||||||
|
export SERVER=$PUFFERFISH_BUILD_FILENAME
|
||||||
export SERVER=pufferfish-${PUFFERFISH_BRANCH}-${PUFFERFISH_BUILD}.jar
|
|
||||||
|
|
||||||
log "Removing old Pufferfish versions ..."
|
log "Removing old Pufferfish versions ..."
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
for f in pufferfish-*.jar; do
|
for f in pufferfish-*.jar; do
|
||||||
[[ $f != $SERVER ]] && rm $f
|
[[ $f != "$SERVER" ]] && rm "$f"
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ ! -f "$SERVER" ] || isTrue "${FORCE_REDOWNLOAD:-false}"; then
|
if [ ! -f "$SERVER" ] || isTrue "${FORCE_REDOWNLOAD:-false}"; then
|
||||||
artifact="build/libs/pufferfish-paperclip-${PUFFERFISH_VERSION}-SNAPSHOT-reobf.jar"
|
log "Downloading Pufferfish from $PUFFERFISH_BUILD_DOWNLOAD_URL ..."
|
||||||
downloadUrl="https://ci.pufferfish.host/job/Pufferfish-${PUFFERFISH_BRANCH}/${PUFFERFISH_BUILD}/artifact/${artifact}"
|
if ! get -o "$SERVER" "$PUFFERFISH_BUILD_DOWNLOAD_URL"; then
|
||||||
log "Downloading Pufferfish from $downloadUrl ..."
|
log "ERROR: failed to download from $PUFFERFISH_BUILD_DOWNLOAD_URL (status=$?)"
|
||||||
if ! get -o "$SERVER" "$downloadUrl"; then
|
|
||||||
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -41,4 +42,4 @@ fi
|
|||||||
# Normalize on Spigot for later operations
|
# Normalize on Spigot for later operations
|
||||||
export FAMILY=SPIGOT
|
export FAMILY=SPIGOT
|
||||||
|
|
||||||
exec ${SCRIPTS:-/}start-spiget "$@"
|
exec "${SCRIPTS:-/}start-spiget" "$@"
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
mc:
|
||||||
|
restart: "no"
|
||||||
|
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||||
|
environment:
|
||||||
|
EULA: "TRUE"
|
||||||
|
SETUP_ONLY: "TRUE"
|
||||||
|
TYPE: PUFFERFISH
|
||||||
|
VERSION: ${MINECRAFT_VERSION:-LATEST}
|
||||||
|
volumes:
|
||||||
|
- ./data:/data
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
[[ $MINECRAFT_VERSION == LATEST ]] || exit 1
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mc-image-helper assert fileExists "/data/pufferfish-*"
|
||||||
Reference in New Issue
Block a user