简体   繁体   English

无法将Jenkins与Bitbucket连接

[英]Not able to connect Jenkins with Bitbucket

I am using redhat6 , Jenkins ver. 1.609.3 我正在使用Jenkins ver. 1.609.3 redhat6 Jenkins ver. 1.609.3 Jenkins ver. 1.609.3 , java1.6_45 and git 2.0.5 . Jenkins ver. 1.609.3java1.6_45git 2.0.5 While cloning the Bitbucket repository with Jenkins I am getting bellow error. 使用Jenkins克隆Bitbucket存储库时,出现以下错误。

 Failed to connect to repository : Command "/usr/local/git/bin/git -c core.askpass=true ls-remote -h git@bitbucket.org:DrunkenCooder/spring3helloworld.git HEAD" returned status code 128: stdout: stderr: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 

错误画面短

This is the path for my git executable 这是我的git可执行文件的路径

/usr/local/git/bin/git

When I go there cd / /usr/local/git/bin and execute the command 当我去那里cd / / usr / local / git / bin并执行命令

 git ls-remote -h git@bitbucket.org:DrunkenCooder/spring3helloworld.git

It is getting executed successfully. 它正在成功执行。 and I get the bellow output 我得到波纹管输出

b148eb99dead9a288afb0c9e6f6e87ae7aa133fe    refs/heads/master

Steps I followed to connect Jenkins with Bitbucket 我遵循的将Jenkins与Bitbucket连接的步骤

  1. created id_rsa and i d_rsa.pub key using ssh-keygen 使用ssh-keygen创建了id_rsad_rsa.pub密钥

    which is there in default location. 在默认位置。 that is home/usrname/.ssh copy the content of id_rsa.pub key in Bitbucket . home/usrname/.ssh复制到Bitbucketid_rsa.pub键的内容。

  2. Copied both id_rsa and id_rsa.pub file in /var/lib/jenkins/.ssh 复制了/var/lib/jenkins/.ssh id_rsa和id_rsa.pub文件
  3. Change the permission of both file to 将两个文件的权限更改为
  4. at first i had generated the key being superuser. 起初,我生成的密钥是超级用户。 I deleted those file and again generated the key using user. 我删除了这些文件,并再次使用用户生成了密钥。 copied the content of id_rsa.pub in Bitbucket . id_rsa.pub的内容id_rsa.pubBitbucket This also dint work 这也可以工作

tried all the solution from here Stack-overflow solution for the same error but dint work. 尝试了此处的所有解决方案,对于相同的错误却有点工作,但出现堆栈溢出解决方案 What am I missing? 我想念什么? any idea. 任何想法。

Try change: 尝试更改:

  1. repository address to https://bitbucket.org/DrunkenCooder/spring3helloworld.git 仓库地址到https://bitbucket.org/DrunkenCooder/spring3helloworld.git
  2. /usr/local/git/bin/git to simple git / usr / local / git / bin / git转换为简单git

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM