简体   繁体   中英

cloning a private git repo in jenkins, bitbucket

I am having errors cloning a private bitbucket repo with Jenkins. I've followed the debug steps from here:

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

  1. Create ssh keys Added ssh key to bitbucket as a deployment key
  2. Successfully cloned that repo with that ssh key in my user account on the server
  3. Copied keys and known hosts into C:\\Windows\\SysWOW64\\config\\systemprofile.ssh
  4. Checked that the Jenkins service was running under local system account
  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

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

Which was incorrect, it should be

git@bitbucket.org:me/project.git

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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