jenkins构建git的java_Jenkins使用Git和Deploy Key构建

在尝试使用Jenkins从GitHub拉取Git仓库时遇到Host key verification failed错误。已添加git插件,生成并配置了jenkins用户的部署密钥,但构建仍然失败。问题可能涉及SSH密钥信任或Jenkins与GitHub的连接设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我将git插件添加到Jenkins。我已经在构建服务器上作为jenkins用户生成了一个公共密钥。我将此密钥作为部署密钥添加到github。我添加了带有詹金斯名称和email的全局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

不确定问题是什么,或者关于配置我忘记了要做什么。任何帮助表示赞赏。让我知道您是否需要更多详细信息。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值