mirror of
https://github.com/itzg/docker-minecraft-server
synced 2025-01-18 23:13:53 +00:00
Merge pull request #268 from Silthus/feat/copy-plugins
feat(minecraft-server): update spigot plugins using /plugins if newer
This commit is contained in:
commit
cc83007cea
2 changed files with 11 additions and 9 deletions
|
@ -14,6 +14,7 @@ RUN apk add --no-cache -U \
|
||||||
jq \
|
jq \
|
||||||
mysql-client \
|
mysql-client \
|
||||||
tzdata \
|
tzdata \
|
||||||
|
rsync \
|
||||||
python python-dev py2-pip
|
python python-dev py2-pip
|
||||||
|
|
||||||
RUN pip install mcstatus
|
RUN pip install mcstatus
|
||||||
|
|
|
@ -36,13 +36,11 @@ done
|
||||||
|
|
||||||
# If any modules have been provided, copy them over
|
# If any modules have been provided, copy them over
|
||||||
mkdir -p /data/mods
|
mkdir -p /data/mods
|
||||||
for m in /mods/*.{jar,zip}
|
if [ -d /mods ]; then
|
||||||
do
|
echo "Copying any mods over..."
|
||||||
if [ -f "$m" -a ! -f "/data/mods/$m" ]; then
|
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --include '*/' --include '*.jar' -include '*.zip' --exclude '*' --update /mods /data
|
||||||
echo Copying mod `basename "$m"`
|
|
||||||
cp "$m" /data/mods
|
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
[ -d /data/config ] || mkdir /data/config
|
[ -d /data/config ] || mkdir /data/config
|
||||||
for c in /config/*
|
for c in /config/*
|
||||||
do
|
do
|
||||||
|
@ -52,10 +50,13 @@ do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
mkdir -p /data/plugins
|
||||||
if [ "$TYPE" = "SPIGOT" ]; then
|
if [ "$TYPE" = "SPIGOT" ]; then
|
||||||
if [ -d /plugins ]; then
|
if [ -d /plugins ]; then
|
||||||
echo Copying any Bukkit plugins over
|
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 '*.jar' --exclude '*' --update /plugins /data
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue