Why couldn't I add a Git url to my Jenkins?

I am very new to git as well as Jenkins.

I added ssh keys to the bitbucket and to my local machine when I do this:

 git clone git@bitbucket.org :username/repo.git 

I can clone.

But when I add the same url ( git@bitbucket.org :username/repo.git ) to the Jenkins repository url, I get the following error:

 Failed to connect to repository : Command "git ls-remote -h git@bitbucket.org :username/repo.git HEAD" returned status code 128: stdout: stderr: Permission denied (publickey). fatal: The remote end hung up unexpectedly 
+3
git bitbucket jenkins
source share
1 answer

You also need to configure ssh keys for the Jenkins user.

The general idea is that you go into the Jenkins window and become the user of "jenkins". You could name your Jenkins user anything, so be sure to use the correct name. When you are a Jenkins user, you can use ssh-keygen to create a new set of ssh keys. You can then add them to your repo as deployment keys .

It may also be useful: Configuring Jenkins with Bitbucket

+6
source share

All Articles