mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-11-10 22:34:22 +00:00
add option for force re-download of server file
Signed-off-by: Jeff Billimek <jeff@billimek.com>
This commit is contained in:
parent
da1a3a47cd
commit
35e2448f8e
6 changed files with 19 additions and 5 deletions
|
@ -537,6 +537,20 @@ If it is a URL, it will only be downloaded into the `/data` directory if it wasn
|
|||
such, if you need to upgrade or re-download the JAR, then you will need to stop the container,
|
||||
remove the file from the container's `/data` directory, and start again.
|
||||
|
||||
## Force re-download of the server file
|
||||
|
||||
For VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, CURSEFORGE, SPONGEVANILLA server types, set
|
||||
`$FORCE_REDOWNLOAD` to some value (e.g. 'true) to force a re-download of the server file for
|
||||
the particular server type. by adding a `-e FORCE_REDOWNLOAD=true` to your command-line.
|
||||
|
||||
For example, with PaperSpigot, it would look something like this:
|
||||
|
||||
```
|
||||
docker run -d -v /path/on/host:/data \
|
||||
-e TYPE=PAPER -e VERSION=1.14.1 -e FORCE_REDOWNLOAD=true \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
```
|
||||
|
||||
## Using Docker Compose
|
||||
|
||||
Rather than type the server options below, the port mappings above, etc
|
||||
|
|
|
@ -72,7 +72,7 @@ case "$TYPE" in
|
|||
;;
|
||||
esac
|
||||
|
||||
if [ ! -f $SERVER ]; then
|
||||
if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
if [[ "$BUILD_SPIGOT_FROM_SOURCE" = TRUE || "$BUILD_SPIGOT_FROM_SOURCE" = true || "$BUILD_FROM_SOURCE" = TRUE || "$BUILD_FROM_SOURCE" = true ]]; then
|
||||
buildSpigotFromSource
|
||||
else
|
||||
|
|
|
@ -6,7 +6,7 @@ if isURL ${CUSTOM_SERVER}; then
|
|||
filename=$(basename ${CUSTOM_SERVER})
|
||||
export SERVER=/data/${filename}
|
||||
|
||||
if [[ -f ${SERVER} ]]; then
|
||||
if [[ -f ${SERVER} ]] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
echo "Using previously downloaded jar at ${SERVER}"
|
||||
else
|
||||
echo "Downloading custom server jar from ${CUSTOM_SERVER} ..."
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
export SERVER=paper_server.jar
|
||||
if [ ! -f $SERVER ]; then
|
||||
if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
downloadUrl=${PAPER_DOWNLOAD_URL:-https://papermc.io/api/v1/paper/${VANILLA_VERSION}/latest/download}
|
||||
echo "Downloading Paper $VANILLA_VERSION from $downloadUrl ..."
|
||||
curl -fsSL -o $SERVER "$downloadUrl"
|
||||
|
|
|
@ -28,7 +28,7 @@ fi
|
|||
|
||||
export SERVER="spongevanilla-$SPONGEVERSION.jar"
|
||||
|
||||
if [ ! -e $SERVER ]; then
|
||||
if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
echo "Downloading $SERVER ..."
|
||||
curl -sSL -o $SERVER https://repo.spongepowered.org/maven/org/spongepowered/$TYPE/$SPONGEVERSION/$SERVER
|
||||
fi
|
||||
|
|
|
@ -5,7 +5,7 @@ set -o pipefail
|
|||
|
||||
export SERVER="minecraft_server.${VANILLA_VERSION// /_}.jar"
|
||||
|
||||
if [ ! -e $SERVER ]; then
|
||||
if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
echo "Downloading $SERVER ..."
|
||||
debug "Finding version manifest for $VANILLA_VERSION"
|
||||
versionManifestUrl=$(curl -fsSL 'https://launchermeta.mojang.com/mc/game/version_manifest.json' | jq --arg VANILLA_VERSION "$VANILLA_VERSION" --raw-output '[.versions[]|select(.id == $VANILLA_VERSION)][0].url')
|
||||
|
|
Loading…
Reference in a new issue