add a "with credentials" step to use the credentials stored in jenkins to ssh into remote hosts

pull/1/head
Chris Veilleux 2019-01-24 17:53:49 -06:00
parent fa8c1b3ead
commit 20c7390a54
1 changed files with 3 additions and 1 deletions

4
Jenkinsfile vendored
View File

@ -20,7 +20,9 @@ pipeline {
stage('Deploy') {
steps {
echo 'Deploying....'
sh 'scp dist root@157.230.91.255:/var/www/'
withCredentials([sshUserPrivateKey(credentialsId: '6413826d-79f6-4d03-9902-ee1b73a96efd', keyFileVariable: 'JENKINS_SSH_KEY', passphraseVariable: '', usernameVariable: '')]) {
sh 'scp dist root@157.230.91.255:/var/www/'
}
}
}
}