I'm trying to setup a Jenkins server to periodically build a project that is stored in git. I've got as far as setting up the server, installing all the tools, setting up Tomcat and installing Jenkins with all of the required plug-ins. I'm now trying to create my first project.
The project is supposed to pull the code from git before building it.
I've gone into Manage Jenkins > Credentials and entered my git credentials. Then I create my project - I enter my repo URL, which is myUser@myServer:myProject.git
and select the credentials I've created. Then message pops up that says:
Failed to connect to repository : Command "git ls-remote -h -- myUser@myServer:myProject.git HEAD" returned status code 128:
stdout:
stderr: Permission denied, please try again.
Permission denied, please try again.
myUser@myServer: Permission denied (publickey,password).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
If I run this command locally, as the tomcat user, it works as expected. I can't understand why it doesn't work inside Jenkins