无法使用Hudson访问私有git存储库 [英] Unable to access private git repositories using Hudson

查看:54
本文介绍了无法使用Hudson访问私有git存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下错误:

Started by user anonymous
Checkout:workspace / /var/lib/hudson/jobs/test2/workspace - hudson.remoting.LocalChannel@1e77243d
Using strategy: Default
Checkout:workspace / /var/lib/hudson/jobs/test2/workspace - hudson.remoting.LocalChannel@1e77243d
Cloning the remote Git repository
Cloning repository origin
ERROR: Error cloning remote repo 'origin' : Could not clone git@github.com:rampelli/test.git
ERROR: Cause: Exception caught during execution of fetch command
Trying next repository
ERROR: Could not clone repository
FATAL: Could not clone
hudson.plugins.git.GitException: Could not clone
        at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:913)
        at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:845)
        at hudson.FilePath.act(FilePath.java:758)
        at hudson.FilePath.act(FilePath.java:740)
        at hudson.plugins.git.GitSCM.gerRevisionToBuild(GitSCM.java:845)
        at hudson.plugins.git.GitSCM.checkout(GitSCM.java:622)
        at hudson.model.AbstractProject.checkout(AbstractProject.java:1479)
        at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:507)
        at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:424)
        at hudson.model.Run.run(Run.java:1366)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
        at hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:145)

没有生成ssh-keygen,我可以访问公共git存储库,但是在添加ssh-keygen之后,我无法访问私有git存储库.

Without generating the ssh-keygen I was able to access public git Repositories, but after adding ssh-keygen I was unable to access private git repositories.

推荐答案

已通过将.ssh文件夹移动到/var/lib/hudson/文件夹,并使chod hudson:hudson使hudson访问.ssh文件而得到修复. ssh/*有效:)

Its fixed by just moving the .ssh folder to /var/lib/hudson/ folder and giving hudson access to .ssh files by just chown hudson:hudson .ssh/* It worked :)

这篇关于无法使用Hudson访问私有git存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆