Using ssh-agent with jenkins during SCM polling

Im using the jenkins ssh-agent plugin in order to provide ssh credentials for my collections that work fine, however I configured it to poll scm (in this case bitbucket git) to check for changes.

And, of course, in order to access the repo in order to poll the changes, it also needs these ssh credentials, I cannot find anything related to this in the wiki, but there must be a way to do this.

It seems that such a stupid thing is not implemented for them, because if you need ssh credentials for cloning and assembly, you will also need them to poll correctly?

+4
source share
4 answers

Removing a passphrase from an SSH key is an unacceptable step.

This jenkins ssh-agent plugin is expected to solve this problem, but as far as I can tell, it is currently broken when it comes to polling

https://issues.jenkins-ci.org/browse/JENKINS-21226

I did not find a viable and safe means to implement communication on the ssh server, which also covers a survey like Jenkins 1.545.

+4
source

Suppose your jobs are running on a Jenkins master. To be able to poll for a Git repository that requires an SSL connection:

  • Backup private key.
  • , : SSH ?
  • Jenkins home dir +.ssh Jenkins f.e. CEntOS /var/lib/jenkins/.ssh. , jenkins ( chmod 600 chown jenkins: jenkins ).
  • Jenkins Credential Manager SSH- f.e./var/lib/jenkins/.ssh/id_rsa
  • Git SSH.

, Job, , .

+2

In git itself, information about plugins contains information about SSH keys:

https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin

Basically, you need to install the keys on the CI user in which you run jenkins. (SSH credential plugin is not integrated.)

0
source

All Articles