2024-09-26 18:37:24 +03:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
|
|
|
|
stages {
|
2024-09-26 20:17:28 +03:00
|
|
|
stage('Copy Files on Server') {
|
2024-09-26 18:37:24 +03:00
|
|
|
steps {
|
2024-09-26 20:21:38 +03:00
|
|
|
withCredentials([usernamePassword(credentialsId: 'QuizServerCreds', usernameVariable: 'USERNAME', passwordVariable: 'SERVER_IP')]) {
|
2024-09-26 21:15:23 +03:00
|
|
|
sh 'touch ~/.ssh/known_hosts'
|
2024-09-26 20:21:38 +03:00
|
|
|
sh 'ssh-keyscan ${SERVER_IP} > ~/.ssh/known_hosts'
|
2024-09-26 20:24:02 +03:00
|
|
|
sh 'rsync -avzhe ssh * ${USERNAME}@${SERVER_IP}:/var/www/public_html'
|
2024-09-26 20:21:38 +03:00
|
|
|
}
|
2024-09-26 18:37:24 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|