Updated Jenkinsfile
Some checks failed
Job Folder/Gitea Instance/psniquiz/pipeline/head There was a failure building this commit

This commit is contained in:
mayekkuzu 2024-09-26 20:21:38 +03:00
parent 02574ab33a
commit bb08e911f4

13
Jenkinsfile vendored
View File

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