Skip to content

Commit

Permalink
Need to be inside of a script block to use variables?
Browse files Browse the repository at this point in the history
  • Loading branch information
fapdash committed Jul 10, 2024
1 parent a69ce02 commit cb24c89
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ pipeline {
stages {
stage('Deploy to server') {
steps {
def remoteUser = 'jenkins'
def remoteServer = "${remoteUser}@${params.REMOTE_SERVER}"
script {
def remoteUser = 'jenkins'
def remoteServer = "${remoteUser}@${params.REMOTE_SERVER}"

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/"
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/"
}
}
}
}
Expand Down

0 comments on commit cb24c89

Please sign in to comment.