withCredentials([
sshUserPrivateKey(
credentialsId: 'creds-id',
keyFileVariable: 'pem',
passphraseVariable: '',
usernameVariable: 'jenkins'
)
]){
script {
sh '''
cp ${pem} keyfile
# Configure GIT_SSH
chmod 600 keyfile
echo \'ssh -i \'`pwd`\'/keyfile -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $*\' > ssh
chmod +x ssh
export GIT_SSH="`pwd`/ssh"
'''
}
}
Created
November 1, 2018 05:30
-
-
Save isaaguilar/a1c7fc5db005d5dcfa7bbd710341efc7 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment