psniquiz/Jenkinsfile
2024-09-26 21:13:31 +03:00

15 lines
496 B
Groovy

pipeline {
agent any
stages {
stage('Copy Files on Server') {
steps {
withCredentials([usernamePassword(credentialsId: 'QuizServerCreds', usernameVariable: 'USERNAME', passwordVariable: 'SERVER_IP')]) {
sh 'mkdir ~/.ssh'
sh 'ssh-keyscan ${SERVER_IP} > ~/.ssh/known_hosts'
sh 'rsync -avzhe ssh * ${USERNAME}@${SERVER_IP}:/var/www/public_html'
}
}
}
}
}