paper: consider release channel when selecting version/build (#2902)

This commit is contained in:
Geoff Bourne 2024-06-15 14:05:14 -05:00 committed by GitHub
parent 47c2b60cba
commit fe5f066a0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 21 additions and 9 deletions

View file

@ -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

View file

@ -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=<url>`.

View file

@ -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"