SCM Sync配置插件不提交/推送

Rod*_*ues 5 jenkins jenkins-plugins

我已经安装了SCM Sync配置插件(0.0.10)以将我的jenkins设置保存在我的git存储库中.

我已经设置了git url存储库,但插件没有提交/推送,请参阅屏幕截图

在此输入图像描述

我试过了:

  • 私钥~/.ssh/id_rsa与chmod 600
  • root用户拥有id_rsa和.ssh目录
  • 该.ssh目录具有权限700
  • 我为jenkinsOS用户做了同样的事情
  • 我可以使用ssh私钥克隆存储库(从控制台),这意味着一切正常

插件状态消息的屏幕截图

在此输入图像描述

如你所见,插件将所有文件复制到我想象这个文件夹应该是git存储库的文件夹中.

插件网页(https://wiki.jenkins-ci.org/display/JENKINS/SCM+Sync+configuration+plugin)我们可以看到相同的"错误"和消息To use a Git server with SSH, you have to accept the server SSH key before using the plugin (same for using Git in Jenkins jobs).,好的,但我想我已经做过了.

该插件的故障排除说它~/.ssh/用于提交设置

https://wiki.jenkins-ci.org/display/JENKINS/ScmSyncConfig+Troubleshootings

我非常喜欢插件的想法,我想使用它,但我不能.

我在AWS上使用ubuntu 14.04,我的git存储库是bitbucket.

怎么了?

Rod*_*ues 2

我解决了这个问题,它不起作用,因为詹金斯正在使用操作系统用户Tomcat7,要检查詹金斯正在使用什么操作系统用户,只需转到詹金斯中的选项Manage jenkins > System Information并查找user.name,我的情况是tomcat7。

要解决这个问题,只需检查用户的路径,该路径可以在 中找到user.home,在我的例子中是/usr/share/tomcat7,我只需将 ssh 密钥文件复制到/usr/share/tomcat7/.ssh

这些文件是

  • /usr/share/tomcat7/.ssh 与chmod 700
  • /usr/share/tomcat7/.ssh/id_rsa 与chmod 600
  • /usr/share/tomcat7/.ssh/id_rsa.pub 与chmod 600

我想这id_rsa.pub(publick key)是没有必要的,之后,插件可以与我的存储库同步。