Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

Jenkins ssh credentials in pipeline

withCredentials([sshUserPrivateKey(credentialsId: "yourkeyid", keyFileVariable: 'keyfile')]) {
       stage('scp-f/b') {
        sh "scp -i ${keyfile} do sth here"
       }
   }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Jenkins #ssh #credentials #pipeline
ADD COMMENT
Topic
Name
3+2 =