When I try to configure the task to build the project from the git repository, I get an error:
Failed to connect to repository : Command "git ls-remote -h ssh:// git@ssh :// git@host.com /path/to/repos.git HEAD" returned status code 128: stdout: stderr: Permission denied (publickey). fatal: The remote end hung up unexpectedly
In Jenkins, I installed the SSH agent plugin and git plugin.
I can add a build step with the following:
git ls-remote -h ssh:// git@host.com /path/to/repos.git HEAD
Run the build and it works!
This tells me that everything is configured correctly:
- Keys and key layout.
- Jenkins / Jenkins Management / Plugin Management β SSH Agent Plugin and git plugin.
- Jenkins / Manage Jenkins / Manage Credentials entry is correct.
This does not seem to work for source control, but for the pre-build / build / post-build operation it does.
Is there a problem with the Ssh agent not being activated before the build process?
Thanks in advance to everyone who can help.
source share