Quantcast
Viewing latest article 19
Browse Latest Browse All 20

Use sshagent Jenkins plugin to expose a specific global credential to…

Use sshagent Jenkins plugin to expose a specific global credential to our build process

We could use Jenkins' core withCredentials() method instead, but that
would require us to setup the agent ourselves. For documentation
purposes, something like:

  withCredentials([sshUserPrivateKey(credentialsId: buildbot,
                                     keyFileVariable: SSH_KEY')]) {
    sh 'eval $(ssh-agent)'
    sh 'ssh-add ${SSH_KEY}'
    sh '/path/to/build.sh'
  }

Comment: MFW-877

Viewing latest article 19
Browse Latest Browse All 20

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>