-
Bug
-
Resolution: Unresolved
-
Trivial
-
None
A Jenkins Freestyle job using a git plugin URL 'hostname:path' (the alternate ssh URL syntax) will fail to clone a private repository even when a credential is associated with the repository in the job definition.
The git plugin or git client plugin seems to ignore credentials defined for ssh alternate URL's which do not include a username component.
Steps to duplicate the problem
- Define an ssh private key credential for the username 'git' to a git provider (I used Assembla)
- Define a Freestyle job that clones from 'hostname:path'. I used git.assembla.com:git-plugin.bin.git
- Assign the ssh private key credential to that git repository in the Freestyle job
- Build the job
- Expected: Successful build Actual: Failed build
If the URL is changed from git.assembla.com:git-plugin.bin.git to git@git.assembla.com:git-plugin.bin.git, the clone succeeds.
If the URL is changed from git.assembla.com:git-plugin.bin.git to ssh://git.assembla/com:git-plugin.git, the clone succeeds.
If the URL is changed from git.assembla.com:git-plugin.bin.git to ssh://git@git.assembla/com:git-plugin.git, the clone succeeds.