简体   繁体   English

在jenkins,bitbucket中克隆一个私人git repo

[英]cloning a private git repo in jenkins, bitbucket

I am having errors cloning a private bitbucket repo with Jenkins. 我在与詹金斯(Jenkins)克隆私人bitbucket存储库时出错。 I've followed the debug steps from here: 我从这里开始遵循调试步骤:

https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin

  1. Create ssh keys Added ssh key to bitbucket as a deployment key 创建ssh密钥将ssh密钥添加到bitbucket中作为部署密钥
  2. Successfully cloned that repo with that ssh key in my user account on the server 使用服务器上我的用户帐户中的ssh密钥成功克隆了该存储库
  3. Copied keys and known hosts into C:\\Windows\\SysWOW64\\config\\systemprofile.ssh 将密钥和已知主机复制到C:\\ Windows \\ SysWOW64 \\ config \\ systemprofile.ssh
  4. Checked that the Jenkins service was running under local system account 检查Jenkins服务是否在本地系统帐户下运行
  5. Start build and then -> Error 开始构建,然后->错误

What am I doing wrong? 我究竟做错了什么?

ERROR: Error cloning remote repo 'origin' : Could not clone ssh:///git@bitbucket.org:myUsername/myRepo.git
    hudson.plugins.git.GitException: Could not clone ssh:///git@bitbucket.org:myUsername/myRepo.git
    Caused by: hudson.plugins.git.GitException: Command "git.exe clone --progress -o origin ssh:///git@bitbucket.org:myUsername/myRepo.git C:\Program Files (x86)\Jenkins\workspace\myProject" returned status code 128:
    stdout: Cloning into 'C:\Program Files (x86)\Jenkins\workspace\myProject'...

    stderr: ssh: connect to host  port 22: Bad file number
    fatal: The remote end hung up unexpectedly

Ok, dumb fix. 好吧,傻瓜修复。

In jenkins I was putting in the reqpository url in the project configuration like their example 在jenkins中,我像他们的示例一样在项目配置中放入了reqpository url

ssh://git@bitbucket.org:me/project.git SSH://git@bitbucket.org:我/ project.git

Which was incorrect, it should be 哪个不正确,应该是

git@bitbucket.org:me/project.git git@bitbucket.org:我/ project.git

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

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