hudson无法从git存储库中获取

时间:2012-01-18 13:22:40

标签: git tomcat hudson tomcat6

我有一台Hudson服务器和一个git存储库,它们都在我们的服务器上运行(一台ubuntu机器)。
每当我尝试使用哈德森构建我的应用程序时,他就会说下面的内容

Iniciado pelo usuário anonymous
Checkout:workspace / /usr/share/tomcat6/.hudson/jobs/ECF/workspace - hudson.remoting.LocalChannel@176150c
Using strategy: Default
Checkout:workspace / /usr/share/tomcat6/.hudson/jobs/ECF/workspace - hudson.remoting.LocalChannel@176150c
Fetching changes from the remote Git repository
Fetching upstream changes from ssh://git@192.168.0.10/git/germantech.git
ERROR: Problem fetching from servidor / servidor - could be unavailable. Continuing anyway
ERROR:  (Underlying report) : Error performing command: git fetch -t ssh://git@192.168.0.10/git/germantech.git +refs/heads/*:refs/remotes/origin/*
Command "git fetch -t ssh://git@192.168.0.10/git/germantech.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: Host key verification failed.
fatal: The remote end hung up unexpectedly

ERROR: Could not fetch from any repository
FATAL: Could not fetch from any repository
hudson.plugins.git.GitException: Could not fetch from any repository

我在这里失踪了什么? 想法?提前谢谢

修改

好的,让它工作!
首先,我已经用我的哈德森用户(sudo su - -s /bin/bash tomcat6)登录,然后我删除了我的.ssh文件夹。
在此之后,我只关注了this链接,并在没有密码的情况下进行了ssh登录 现在,hudson可以进行提取而无需指定密码

2 个答案:

答案 0 :(得分:8)

您需要在hudson和git服务器之间创建一个ssh关系。

你只需要这样做一次。

步骤:

  1. 使用hudson用户登录hudson机器。

  2. 创建一个ssh私钥和公钥:

    ssh-keygen -t dsa
    留下一个空的passphase 现在你在.ssh文件夹下的hudson home中有2个文件:id_dsa和id_dsa.pub。

  3. 使用以下方法将密钥复制到您的仓库:

    ssh-copy-id -i ~/.ssh/id_dsa.pub hudson@gitserver.machine.com

  4. 退出并验证您现在可以ssh而无需提供密码。

  5. 哈德森现在应该能够连接。

答案 1 :(得分:1)

我删除了.ssh主文件夹中的tomcat6文件夹(hudson在这里运行tomcat 6用户,因为我使用了哈德森的战争),然后使用了this教程,它终于工作了< / p>