: / with Jenkins What I have: a.b.c.d:/x/www/app Now...">

Is it possible to clone a git repo when given "<IP Addresses>: / <Application Path> with Jenkins

What I have:

a.b.c.d:/x/www/app

      

Now if I issue the command:

git clone abcd: / x / www / app / home / user

I will be prompted for my LDAP password and then clone the application successfully.

But when I use the same with Jenkins, Jenkins gives an error:

Failed to connect to repository: command "/ usr / bin / git ls-remote -h abcd: / x / www / app HEAD" returns status code 128: stdout: stderr: Host key verification failed. fatal: the remote end hung up unexpectedly

I am using Jenkins version 1.500 and Git version 1.1.26

ERROR:

Using strategy: Default
Cloning the remote Git repository
Cloning repository git:///$GIT_USER@a.b.c.d:/var/www/app
git --version
git version 1.7.9.5
ERROR: Error cloning remote repo 'origin' : Could not clone git:///$GIT_USER@a.b.c.d:/var/www/app
hudson.plugins.git.GitException: Could not clone git:///$GIT_USER@a.b.c.d:/var/www/app
    at hudson.plugins.git.GitAPI.clone(GitAPI.java:273)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1044)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:986)
    at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2348)
    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:326)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:679)
Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git clone --progress -o origin git:///$GIT_USER@a.b.c.d:/var/www/app /home/user/workspace/app" returned status code 128:
stdout: Cloning into '/home/user/workspace/app'...

stderr: fatal: unable to connect to :
: Name or service not known


    at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:897)
    at hudson.plugins.git.GitAPI.access$000(GitAPI.java:42)
    at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:269)
    at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:248)
    at hudson.FilePath.act(FilePath.java:865)
    at hudson.FilePath.act(FilePath.java:838)
    at hudson.plugins.git.GitAPI.clone(GitAPI.java:248)
    ... 12 more
Trying next repository
ERROR: Could not clone repository
FATAL: Could not clone
hudson.plugins.git.GitException: Could not clone
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1056)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:986)
    at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2348)
    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:326)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:679)

      

+3


source to share


2 answers


git: // protocol doesn't use authentication.

If you want to use the protocol, you need to run git -daemon on the server side repository.



If ssh with username / key based authentication is what you wanted, use ssh: // $ USER / path instead.

+1


source


you can use git + ssh: // mylogin @mygithost: /var/git/race.git

if you are using ssh you can edit or create in jenkins user home dir: ~ / .ssh / config to store ssh key



Host mygithost
        HostName 192.168.130.43
        User mylogin
        IdentityFile ~/.ssh/.id_rsa

      

with ssh key, you can add the public key on the git server (~ / .ssh / authorized_keys) to prevent password authorization ...

0


source







All Articles