From c764961418969e149f1197a8c25e48fca3c772d3 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 15 Jun 2024 13:52:01 -0500 Subject: [PATCH] paper: consider release channel when selecting version/build --- Dockerfile | 2 +- .../types-and-platforms/server-types/paper.md | 20 ++++++++++++++----- scripts/start-deployPaper | 8 +++++--- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 047de82fc3f..6de91b53ab9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,7 +47,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ --var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \ --from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz -ARG MC_HELPER_VERSION=1.38.16 +ARG MC_HELPER_VERSION=1.39.0 ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION} # used for cache busting local copy of mc-image-helper ARG MC_HELPER_REV=1 diff --git a/docs/types-and-platforms/server-types/paper.md b/docs/types-and-platforms/server-types/paper.md index cfdec0ad280..26043562583 100644 --- a/docs/types-and-platforms/server-types/paper.md +++ b/docs/types-and-platforms/server-types/paper.md @@ -1,10 +1,20 @@ -Enable Paper server mode by adding a `-e TYPE=PAPER` to your command-line. +A [PaperMC server](https://papermc.io/) can be automatically downloaded, upgraded, and run by setting the environment variable TYPE to "PAPER". -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`. +By default, the container will find and download the latest build for the `VERSION` chosen. If `VERSION` is not specified, then the latest Minecraft version released by PaperMC is selected. Along with a specific `VERSION`, a specific Paper build can be selected by setting the environment variable `PAPER_BUILD`. - docker run -d -v /path/on/host:/data \ - -e TYPE=PAPER \ - -p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server +To allow for the selection of experimental builds, set `PAPER_CHANNEL` to "experimental", otherwise only release/default channel builds are selected. + +!!! example + + ``` + docker run ... -e TYPE=PAPER ... + + docker run ... -e TYPE=PAPER -e VERSION=1.20.6 ... + + docker run ... -e TYPE=PAPER -e VERSION=1.20.6 -e PAPER_BUILD=140 ... + + docker run ... -e TYPE=PAPER -e PAPER_CHANNEL=experimental ... + ``` If you are hosting your own copy of Paper you can override the download URL with `PAPER_DOWNLOAD_URL=`. diff --git a/scripts/start-deployPaper b/scripts/start-deployPaper index 087ccd3ee1e..53baad26360 100755 --- a/scripts/start-deployPaper +++ b/scripts/start-deployPaper @@ -6,7 +6,8 @@ set -o pipefail handleDebugMode : "${PAPER_PROJECT:=paper}" -: "${PAPERBUILD:=}" +: "${PAPER_BUILD:=${PAPERBUILD:-}}" +: "${PAPER_CHANNEL:=default}" : "${PAPER_DOWNLOAD_URL:=}" : "${PAPER_CUSTOM_JAR:=}" : "${PAPER_CONFIG_DEFAULTS_REPO:=https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main}" @@ -34,9 +35,10 @@ else --results-file="$resultsFile" --project="$PAPER_PROJECT" --version="$VERSION" + --channel="$PAPER_CHANNEL" ) - if [[ $PAPERBUILD ]]; then - args+=(--build="$PAPERBUILD") + if [[ $PAPER_BUILD ]]; then + args+=(--build="$PAPER_BUILD") fi if ! mc-image-helper install-paper "${args[@]}"; then log "ERROR: failed to download $PAPER_PROJECT"