Updated Jenkinsfile
Some checks failed
Job Folder/Gitea Instance/psniquiz/pipeline/head There was a failure building this commit
Some checks failed
Job Folder/Gitea Instance/psniquiz/pipeline/head There was a failure building this commit
This commit is contained in:
parent
6f5df06e45
commit
6d6fcaccf9
12
Jenkinsfile
vendored
12
Jenkinsfile
vendored
@ -1,10 +1,18 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
|
environment {
|
||||||
|
withCredentials([usernamePassword(credentialsId: 'QuizServerCreds', usernameVariable: 'USERNAME', passwordVariable: 'SERVER_IP')]) {
|
||||||
|
SERVER_USERNAME = "${USERNAME}"
|
||||||
|
SERVER_IP = "${SERVER_IP}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Do nothing') {
|
stage('Copy Files on Server') {
|
||||||
steps {
|
steps {
|
||||||
sh 'ls'
|
sh 'ssh-keyscan ${SERVER_IP} > ~/.ssh/known_hosts'
|
||||||
|
sh 'rsync -avzhe --exclude 'Jenkinsfile' ssh * ${SERVER_USERNAME}@${SERVER_IP}:/var/www/public_html'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user