From fd4e9d93e0c6402f33ee1fec67a10ec667960b6f Mon Sep 17 00:00:00 2001 From: Michael Reichenbach Date: Fri, 14 Dec 2018 08:13:19 +0100 Subject: [PATCH] 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. --- minecraft-server/Dockerfile | 1 + minecraft-server/start-minecraftFinalSetup | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/minecraft-server/Dockerfile b/minecraft-server/Dockerfile index f8c1e526..f3d6e3ae 100644 --- a/minecraft-server/Dockerfile +++ b/minecraft-server/Dockerfile @@ -14,6 +14,7 @@ RUN apk add --no-cache -U \ jq \ mysql-client \ tzdata \ + rsync \ python python-dev py2-pip RUN pip install mcstatus diff --git a/minecraft-server/start-minecraftFinalSetup b/minecraft-server/start-minecraftFinalSetup index 4b5a026e..06b45a55 100755 --- a/minecraft-server/start-minecraftFinalSetup +++ b/minecraft-server/start-minecraftFinalSetup @@ -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