psniquiz/Jenkinsfile
mayekkuzu aed8413a34
Some checks failed
Job Folder/Gitea Instance/psniquiz/pipeline/head There was a failure building this commit
Updated Jenkinsfile
2024-09-26 20:23:28 +03:00

14 lines
484 B
Groovy

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