Merge pull request #268 from Silthus/feat/copy-plugins

feat(minecraft-server): update spigot plugins using /plugins if newer
This commit is contained in:
Geoff Bourne 2018-12-15 09:09:42 -06:00 committed by GitHub
commit cc83007cea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 9 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

@ -36,13 +36,11 @@ done
# If any modules have been provided, copy them over
mkdir -p /data/mods
for m in /mods/*.{jar,zip}
do
if [ -f "$m" -a ! -f "/data/mods/$m" ]; then
echo Copying mod `basename "$m"`
cp "$m" /data/mods
fi
done
if [ -d /mods ]; then
echo "Copying any mods over..."
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --include '*/' --include '*.jar' -include '*.zip' --exclude '*' --update /mods /data
fi
[ -d /data/config ] || mkdir /data/config
for c in /config/*
do
@ -52,10 +50,13 @@ do
fi
done
mkdir -p /data/plugins
if [ "$TYPE" = "SPIGOT" ]; then
if [ -d /plugins ]; then
echo Copying any Bukkit plugins over
cp -r /plugins /data
echo "Copying any Bukkit plugins over..."
# 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 '*.jar' --exclude '*' --update /plugins /data
fi
fi