feat(minecraft-server): update spigot plugins using /plugins if newer

Deep copy and *.jar files in /plugins and update the corresponding files
in the /data/plugins dir.
This commit is contained in:
Michael Reichenbach
2018-12-14 08:13:19 +01:00
parent 2e353c084a
commit fd4e9d93e0
2 changed files with 5 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ RUN apk add --no-cache -U \
jq \
mysql-client \
tzdata \
rsync \
python python-dev py2-pip
RUN pip install mcstatus

View File

@@ -54,8 +54,12 @@ done
if [ "$TYPE" = "SPIGOT" ]; then
if [ -d /plugins ]; then
# Copy all of the plugins directory first to include initial configs
echo Copying any Bukkit plugins over
cp -r /plugins /data
# Copy plugins over using rsync to allow deeply nested updates of plugins
# only updates files if the source file is newer and print updated files
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --include '*/' --include '*.txt' --exclude '*' --update /plugins /data/plugins
fi
fi