From 17393bc297785cfb81f84352d945ab1a122e811e Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Fri, 20 May 2022 15:58:47 -0500 Subject: [PATCH] Deployment now deploys generated dynmap files. --- Jenkinsfile | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fb9a165..d27afda 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,6 +21,20 @@ pipeline { fileOperations([fileDeleteOperation(excludes: '', includes: 'mods/DynmapBlockScan.jar')]) } } + stage("deploy") { + when { + branch '**/master' + } + steps { + sshagent(['ce4c701d-098c-4706-8f32-c0af996a7769']) { + pwsh "ssh -o StrictHostKeyChecking=no gamehost@entertainment 'systemctl --user stop rsemcs'" + pwsh "rsync -a --update --filter=':- .gitignore' --exclude=./mods/ --exclude=./config/ ./** gamehost@entertainment:/home/gamehost/mcserver/" + pwsh "rsync -a --update --filter=':- .gitignore' --delete ./mods/ gamehost@entertainment:/home/gamehost/mcserver/mods" + pwsh "rsync -a --update --filter=':- .gitignore' --delete ./config gamehost@entertainment:/home/gamehost/mcserver/config" + pwsh "ssh gamehost@entertainment 'systemctl --user start rsemcs'" + } + } + } stage("cleanup") { when { not { @@ -29,21 +43,6 @@ pipeline { } steps { pwsh "git clean -dfX" - fileOperations([folderDeleteOperation('world')]) - } - } - stage("deploy") { - when { - branch '**/master' - } - steps { - sshagent(['ce4c701d-098c-4706-8f32-c0af996a7769']) { - pwsh "ssh -o StrictHostKeyChecking=no gamehost@entertainment 'systemctl --user stop rsemcs'" - pwsh "rsync -a --update --exclude ./mods/ --exclude ./config/ ./** gamehost@entertainment:/home/gamehost/mcserver/" - pwsh "rsync -a --update --delete ./mods/ gamehost@entertainment:/home/gamehost/mcserver/mods" - pwsh "rsync -a --update --delete --exclude '*.json' ./* gamehost@entertainment:/home/gamehost/mcserver/" - pwsh "ssh gamehost@entertainment 'systemctl --user start rsemcs'" - } } } }