From 9a7a532f7b1d4cd362dcf46bcaade928d9476a2b Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 6 Jul 2020 17:16:51 -0500 Subject: [PATCH] Changed order of /plugins rsync to be before processing env vars For #577 --- DEVELOPMENT.md | 2 +- start-deployBukkitSpigot | 2 +- start-deployCatserver | 2 +- start-deployCustom | 2 +- start-deployFTB | 2 +- start-deployFabric | 2 +- start-deployForge | 2 +- start-deployMagma | 2 +- start-deployMohist | 2 +- start-deployPaper | 2 +- start-deploySpongeVanilla | 2 +- start-deployTuinity | 2 +- start-deployVanilla | 2 +- ...EnvVariables => start-finalSetupEnvVariables | 0 ...etup03Modconfig => start-finalSetupModconfig | 2 +- ...nalSetup02Modpack => start-finalSetupModpack | 2 +- start-finalSetupPlugins | 17 +++++++++++++++++ ...operties => start-finalSetupServerProperties | 2 +- ...t-finalSetup01World => start-finalSetupWorld | 2 +- start-minecraftFinalSetup | 12 ------------ start-validateCurseInstance | 2 +- 21 files changed, 35 insertions(+), 30 deletions(-) rename start-finalSetup05EnvVariables => start-finalSetupEnvVariables (100%) rename start-finalSetup03Modconfig => start-finalSetupModconfig (92%) rename start-finalSetup02Modpack => start-finalSetupModpack (99%) create mode 100755 start-finalSetupPlugins rename start-finalSetup04ServerProperties => start-finalSetupServerProperties (99%) rename start-finalSetup01World => start-finalSetupWorld (96%) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 2dde41d3..55bea272 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -3,7 +3,7 @@ Adding a new server `TYPE` can vary due to the complexity of obtaining and configuring each type; however, the addition of any server type includes at least the following steps: 1. Copy an existing "start-deploy*" script, such as [start-deployMohist](start-deployMohist) and rename it accordingly making sure to retain the "start-deploy" prefix -2. Modify the type-specific behavior between the "start-utils" preamble and the hand-off to `start-finalSetup01World` at the end of the script +2. Modify the type-specific behavior between the "start-utils" preamble and the hand-off to `start-finalSetupWorld` at the end of the script 3. Develop and test the changes using the [iterative process described below](#iterative-script-development) 4. Add a case-entry to the `case "${TYPE^^}"` in [start-configuration](start-configuration) 5. Add a section to the [README](README.md). It is recommended to copy-modify an existing section to retain a similar wording and level of detail diff --git a/start-deployBukkitSpigot b/start-deployBukkitSpigot index d995089a..28b07fd3 100644 --- a/start-deployBukkitSpigot +++ b/start-deployBukkitSpigot @@ -102,4 +102,4 @@ export TYPE=SPIGOT export SKIP_LOG4J_CONFIG=true # Continue to Final Setup -exec ${SCRIPTS:-/}start-finalSetup01World $@ +exec ${SCRIPTS:-/}start-finalSetupWorld $@ diff --git a/start-deployCatserver b/start-deployCatserver index ce9ea6cd..093769ec 100644 --- a/start-deployCatserver +++ b/start-deployCatserver @@ -29,4 +29,4 @@ fi export SKIP_LOG4J_CONFIG=true # Continue to Final Setup -exec ${SCRIPTS:-/}start-finalSetup01World "$@" +exec ${SCRIPTS:-/}start-finalSetupWorld "$@" diff --git a/start-deployCustom b/start-deployCustom index 31105e4e..571a5a0c 100644 --- a/start-deployCustom +++ b/start-deployCustom @@ -28,4 +28,4 @@ fi export SKIP_LOG4J_CONFIG=true # Continue to Final Setup -exec ${SCRIPTS:-/}start-finalSetup01World $@ +exec ${SCRIPTS:-/}start-finalSetupWorld $@ diff --git a/start-deployFTB b/start-deployFTB index 5006f24b..5e2b5c4f 100644 --- a/start-deployFTB +++ b/start-deployFTB @@ -135,4 +135,4 @@ elif [ -e "${FTB_DIR}/Install.sh" ]; then fi # Continue to Final Setup -exec ${SCRIPTS:-/}start-finalSetup01World $@ +exec ${SCRIPTS:-/}start-finalSetupWorld $@ diff --git a/start-deployFabric b/start-deployFabric index b0bc1329..0c748455 100644 --- a/start-deployFabric +++ b/start-deployFabric @@ -75,4 +75,4 @@ else fi # Contineut to Final Setup -exec ${SCRIPTS:-/}start-finalSetup01World $@ +exec ${SCRIPTS:-/}start-finalSetupWorld $@ diff --git a/start-deployForge b/start-deployForge index 8feb33ea..e58d885c 100644 --- a/start-deployForge +++ b/start-deployForge @@ -113,4 +113,4 @@ else fi # Continue to Final Setup -exec ${SCRIPTS:-/}start-finalSetup01World $@ +exec ${SCRIPTS:-/}start-finalSetupWorld $@ diff --git a/start-deployMagma b/start-deployMagma index a8c7c6a3..cf590ca5 100644 --- a/start-deployMagma +++ b/start-deployMagma @@ -15,4 +15,4 @@ fi export SKIP_LOG4J_CONFIG=true # Continue to Final Setup -exec ${SCRIPTS:-/}start-finalSetup01World $@ +exec ${SCRIPTS:-/}start-finalSetupWorld $@ diff --git a/start-deployMohist b/start-deployMohist index 9a0ca008..1c67bd08 100644 --- a/start-deployMohist +++ b/start-deployMohist @@ -40,4 +40,4 @@ fi export SKIP_LOG4J_CONFIG=true # Continue to Final Setup -exec ${SCRIPTS:-/}start-finalSetup01World "$@" +exec ${SCRIPTS:-/}start-finalSetupWorld "$@" diff --git a/start-deployPaper b/start-deployPaper index 018efa63..f3d12472 100644 --- a/start-deployPaper +++ b/start-deployPaper @@ -20,4 +20,4 @@ export TYPE=SPIGOT export SKIP_LOG4J_CONFIG=true # Continue to Final Setup -exec ${SCRIPTS:-/}start-finalSetup01World $@ +exec ${SCRIPTS:-/}start-finalSetupWorld $@ diff --git a/start-deploySpongeVanilla b/start-deploySpongeVanilla index 28c5ab73..199107cb 100644 --- a/start-deploySpongeVanilla +++ b/start-deploySpongeVanilla @@ -36,4 +36,4 @@ if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then fi # Continue to Final Setup -exec ${SCRIPTS:-/}start-finalSetup01World $@ +exec ${SCRIPTS:-/}start-finalSetupWorld $@ diff --git a/start-deployTuinity b/start-deployTuinity index 8e6adc62..f2c6f039 100644 --- a/start-deployTuinity +++ b/start-deployTuinity @@ -24,4 +24,4 @@ fi export TYPE=SPIGOT # Continue to Final Setup -exec ${SCRIPTS:-/}start-finalSetup01World $@ +exec ${SCRIPTS:-/}start-finalSetupWorld $@ diff --git a/start-deployVanilla b/start-deployVanilla index 52dc92e7..59283b15 100644 --- a/start-deployVanilla +++ b/start-deployVanilla @@ -43,4 +43,4 @@ fi isDebugging && ls -l # Continue to Final Setup -exec ${SCRIPTS:-/}start-finalSetup01World $@ +exec ${SCRIPTS:-/}start-finalSetupWorld $@ diff --git a/start-finalSetup05EnvVariables b/start-finalSetupEnvVariables similarity index 100% rename from start-finalSetup05EnvVariables rename to start-finalSetupEnvVariables diff --git a/start-finalSetup03Modconfig b/start-finalSetupModconfig similarity index 92% rename from start-finalSetup03Modconfig rename to start-finalSetupModconfig index 5758a25c..0ba355eb 100644 --- a/start-finalSetup03Modconfig +++ b/start-finalSetupModconfig @@ -24,4 +24,4 @@ case "X$MODCONFIG" in esac fi -exec ${SCRIPTS:-/}start-finalSetup04ServerProperties $@ +exec ${SCRIPTS:-/}start-finalSetupPlugins $@ diff --git a/start-finalSetup02Modpack b/start-finalSetupModpack similarity index 99% rename from start-finalSetup02Modpack rename to start-finalSetupModpack index 15347cf9..40962733 100644 --- a/start-finalSetup02Modpack +++ b/start-finalSetupModpack @@ -154,4 +154,4 @@ if [[ "${GENERIC_PACK}" ]]; then fi fi -exec ${SCRIPTS:-/}start-finalSetup03Modconfig $@ +exec ${SCRIPTS:-/}start-finalSetupModconfig $@ diff --git a/start-finalSetupPlugins b/start-finalSetupPlugins new file mode 100755 index 00000000..5bb2fe83 --- /dev/null +++ b/start-finalSetupPlugins @@ -0,0 +1,17 @@ +#!/bin/bash + +. ${SCRIPTS:-/}start-utils + +if [ -d /plugins ]; then + case ${TYPE} in + SPIGOT|BUKKIT|PAPER) + mkdir -p /data/plugins + log "Copying 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 --update /plugins /data + ;; + esac +fi + +exec ${SCRIPTS:-/}start-finalSetupServerProperties $@ diff --git a/start-finalSetup04ServerProperties b/start-finalSetupServerProperties similarity index 99% rename from start-finalSetup04ServerProperties rename to start-finalSetupServerProperties index 9f2bad70..32608c47 100644 --- a/start-finalSetup04ServerProperties +++ b/start-finalSetupServerProperties @@ -206,4 +206,4 @@ if isDebugging; then cat /data/server.properties fi -exec ${SCRIPTS:-/}start-finalSetup05EnvVariables $@ +exec ${SCRIPTS:-/}start-finalSetupEnvVariables $@ diff --git a/start-finalSetup01World b/start-finalSetupWorld similarity index 96% rename from start-finalSetup01World rename to start-finalSetupWorld index 1cb3bfff..b55f96cc 100644 --- a/start-finalSetup01World +++ b/start-finalSetupWorld @@ -51,4 +51,4 @@ if [[ "$WORLD" ]] && [ ! -d "$worldDest" ]; then fi fi -exec ${SCRIPTS:-/}start-finalSetup02Modpack $@ +exec ${SCRIPTS:-/}start-finalSetupModpack $@ diff --git a/start-minecraftFinalSetup b/start-minecraftFinalSetup index 0e1edc87..1d20da55 100644 --- a/start-minecraftFinalSetup +++ b/start-minecraftFinalSetup @@ -66,18 +66,6 @@ do fi done -case ${TYPE} in - SPIGOT|BUKKIT|PAPER) - mkdir -p /data/plugins - if [ -d /plugins ]; then - log "Copying 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 --update /plugins /data - fi - ;; -esac - EXTRA_ARGS="" # Optional disable console if versionLessThan 1.14 && [[ ${CONSOLE,,} = false ]]; then diff --git a/start-validateCurseInstance b/start-validateCurseInstance index 60bb2edd..f3563990 100755 --- a/start-validateCurseInstance +++ b/start-validateCurseInstance @@ -15,4 +15,4 @@ fi log "Resolved CURSE_INSTANCE_JSON as ${CURSE_INSTANCE_JSON}" # Continue to Final Setup -exec ${SCRIPTS:-/}start-finalSetup01World "$@" +exec ${SCRIPTS:-/}start-finalSetupWorld "$@"