From a69ce02622a6dba5c488e15288070b3974f20c65 Mon Sep 17 00:00:00 2001 From: fap <459631+fapdash@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:22:10 +0200 Subject: [PATCH] Fix referencing unassigned variable --- Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index aeb5fe8..765bcd5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,10 +10,11 @@ pipeline { stages { stage('Deploy to server') { steps { + def remoteUser = 'jenkins' def remoteServer = "${remoteUser}@${params.REMOTE_SERVER}" - sh "rsync -rzvhP --delete _site/* jenkins@${remoteServer}:/var/www/vhosts/larp-hamburg/staging" - sh "ssh jenkins@${remoteServer} rsync -rzvhP --delete /var/www/vhosts/larp-hamburg/staging/* /var/www/vhosts/larp-hamburg/www/" + sh "rsync -rzvhP --delete _site/* ${remoteServer}:/var/www/vhosts/larp-hamburg/staging" + sh "ssh ${remoteServer} rsync -rzvhP --delete /var/www/vhosts/larp-hamburg/staging/* /var/www/vhosts/larp-hamburg/www/" } } }