我似乎一直试图将 Jenkins(Ubuntu 的 EC2 AWS 实例)与 Bitbucket 链接起来。
每当我尝试构建我的项目(我已经在 Jenkins 上安装了 git 插件)时,我都会得到......
Building in workspace /var/lib/jenkins/jobs/Google adwords/workspace
Checkout:workspace / /var/lib/jenkins/jobs/Google adwords/workspace - hudson.remoting.LocalChannel@2c473996
Using strategy: Default
Cloning the remote Git repository
Cloning repository origin
ERROR: Error cloning remote repo 'origin' : Could not clone git@bitbucket.org:DAVID99WORLD/assessme.git
hudson.plugins.git.GitException: Could not clone git@bitbucket.org:DAVID99WORLD/assessme.git
at hudson.plugins.git.GitAPI.clone(GitAPI.java:268)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1122)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1064)
at hudson.FilePath.act(FilePath.java:842)
at hudson.FilePath.act(FilePath.java:824)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1064)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1256)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:589)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:494)
at hudson.model.Run.execute(Run.java:1502)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:236)
Caused by: hudson.plugins.git.GitException: Command "git clone --progress -o origin git@bitbucket.org:DAVID99WORLD/assessme.git /var/lib/jenkins/jobs/Google adwords/workspace" returned status code 128:
stdout: Cloning into '/var/lib/jenkins/jobs/Google adwords/workspace'...
stderr: Host key verification failed.
fatal: The remote end hung up unexpectedly
很好 - 看起来它正在尝试通过 ssh 但找不到密钥。所以我正在尝试生成密钥,在~/.ssh
我有文件的情况下authorized_keys
,known_hosts
但根据这里的文档......
我应该在 ~/.ssh 下有一个名为 id_rsa 的文件
我一直在关注文档...
https://confluence.atlassian.com/display/BITBUCKET/Using+the+SSH+protocol+with+bitbucket
但它看起来几乎完成了一半,或者我错过了将密钥放入正确文件的位置。
首先 - 我的假设是否正确这是一个 ssh 问题?其次,如果是的话,有谁知道如何让密钥匹配,以便詹金斯可以进行拉动和构建?
编辑:我认为这是一个 ssh 问题,因为Jenkins Build Using Git with Deploy Key是相关的,但我使用的是 bitbucket 而不是 github。