Use an SSH username and private key combination
This commit is contained in:
parent
5a6f49d286
commit
e473acb3c9
1 changed files with 10 additions and 3 deletions
13
Jenkinsfile
vendored
13
Jenkinsfile
vendored
|
@ -46,9 +46,16 @@ pipeline {
|
||||||
unstash 'public_html'
|
unstash 'public_html'
|
||||||
unstash 'public_css'
|
unstash 'public_css'
|
||||||
|
|
||||||
withCredentials([file(credentialsId: 'ryuslash.org-deploy-key-2', variable: 'KEY_FILE'),
|
withCredentials([
|
||||||
file(credentialsId: 'ryuslash-known-hosts', variable: 'KNOWN_HOSTS_FILE')]) {
|
sshUserPrivateKey(
|
||||||
sh 'rsync -e "ssh -p 4511 -o \\"UserKnownHostsFile $KNOWN_HOSTS_FILE\\" -i $KEY_FILE" -v -c -r --delete public/ "site@ryuslash.org:"'
|
credentialsId: 'ryuslash.org-deploy-key-2',
|
||||||
|
keyFileVariable: 'KEY_FILE',
|
||||||
|
usernameVariable: 'USERNAME'),
|
||||||
|
file(
|
||||||
|
credentialsId: 'ryuslash-known-hosts',
|
||||||
|
variable: 'KNOWN_HOSTS_FILE')
|
||||||
|
]) {
|
||||||
|
sh 'rsync -e "ssh -p 4511 -o \\"UserKnownHostsFile $KNOWN_HOSTS_FILE\\" -i $KEY_FILE" -v -c -r --delete public/ "$USERNAME@ryuslash.org:"'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue