Add the ability to define a configuration repo that's also live-downloaded

This commit is contained in:
Salt 2021-05-29 14:22:53 -05:00
parent 60943d2f82
commit 62c4ef86af
2 changed files with 12 additions and 0 deletions

View File

@ -39,6 +39,7 @@ variable|description
`JRE_XMX`|Maximum amount of heap passed to the main Minecraft process
`JRE_XMS`|Minimum heap size passed to the main Minecraft process
`FORGE_PACK_ZIP`|If provided, the URL to a zip or tar.gz file that contains the modpack that needs to be installed. Will be intelligently extracted into the server directory through the magic of `find`.
`CONFIG_REPO`|If provided, the URI to a git repository that contains configuration to copy over top the pack. The root of the repo will be the root of the server directory.
`ARGS`|Any additional arguments to be passed to the JVM
## Useful Arguments

View File

@ -20,6 +20,17 @@ if [ -n "$FORGE_PACK_ZIP" ]; then
popd > /dev/null 2>&1
fi
# Then also download and extract a config repo, if one exists
if [ -n "$CONFIG_REPO" ]; then
echo "Downloading config repo: $CONFIG_REPO"
tmpdir="$(mktemp -d)"
pushd "$tmpdir" > /dev/null 2>&1
git clone "$CONFIG_REPO" .
rm -rf .git
rsync -av ./ /minecraft/
popd > /dev/null 2>&1
fi
# Entrypoint will be server.jar
args="-jar server.jar nogui"