我将 git 插件添加到 Jenkins。我已经在构建服务器上以 jenkins 用户的身份生成了一个公钥。我将此密钥作为部署密钥添加到 github。我添加了带有 jenkins 名称和电子邮件的全局 git 属性,并且电子邮件与公钥末尾的内容相匹配。
当 Jenkins 尝试从 git 存储库(托管在 Github)中提取时,我得到以下信息:
Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/Test Deployment/workspace
Checkout:workspace / /var/lib/jenkins/jobs/Test Deployment/workspace - hudson.remoting.LocalChannel@9ba3afe
Using strategy: Default
Cloning the remote Git repository
Cloning repository origin
ERROR: Error cloning remote repo 'origin' : Could not clone git@github.com:GenRocket/GenRocket.git
hudson.plugins.git.GitException: Could not clone git@github.com:GenRocket/GenRocket.git
at hudson.plugins.git.GitAPI.clone(GitAPI.java:245)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1121)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1063)
at hudson.FilePath.act(FilePath.java:839)
at hudson.FilePath.act(FilePath.java:821)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1063)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1218)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:586)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:475)
at hudson.model.Run.run(Run.java:1438)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:239)
Caused by: hudson.plugins.git.GitException: Command "git clone --progress -o origin git@github.com:GenRocket/GenRocket.git /var/lib/jenkins/jobs/Test Deployment/workspace" returned status code 128:
stdout: Cloning into /var/lib/jenkins/jobs/Test Deployment/workspace...
stderr: Host key verification failed.
fatal: The remote end hung up unexpectedly
不知道问题是什么,或者我忘记在配置方面做什么。任何帮助表示赞赏。如果您需要更多详细信息,请告诉我。