Jenkins:Gerrit触发器问题的设置 [英] Jenkins: settings for Gerrit Trigger problems

查看:1226
本文介绍了Jenkins:Gerrit触发器问题的设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Jenkins cos上安装了Gerrit Trigger插件,当团队中的开发人员将某些内容(相对于特定项目)推送到存储库中时,我需要自动开始构建.我在这里遵循了设置:

I've installed the plugin Gerrit Trigger on Jenkins cos I need to start automatically the building when a developer in the team pushes something on the repository (relative to a specific project). I followed the settings here:

https://wiki.jenkins-ci.org/display/JENKINS/Gerrit + Trigger

测试连接正常.无论如何,当有东西被推动时,建筑物就不会触发".我唯一看到的是:

The test connection is ok. Anyway when something is pushed the building doesn't "trigger". The only thing I can see is:

在管理詹金斯"下->与Gerrit的连接断开!检查您的设置和Gerrit服务器.

Under "Manage Jenkins" -> The connection to Gerrit is down! Check your settings and the Gerrit server.

有什么主意吗?

谢谢

随机

顺便说一句,我明白了:

BTW I got this:

顺便说一句,我得到了:命令"git fetch -t git@github.com:somewhere/MyProject.git $ GERRIT_REFSPEC"返回了状态码128:致命:找不到远程引用$ GERRIT_REFSPEC 致命:远端意外挂起

BTW I got this: Command "git fetch -t git@github.com:somewhere/MyProject.git $GERRIT_REFSPEC" returned status code 128: fatal: Couldn't find remote ref $GERRIT_REFSPEC 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
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1008)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:968)
at hudson.FilePath.act(FilePath.java:758)
at hudson.FilePath.act(FilePath.java:740)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:968)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1184)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:537)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:425)
at hudson.model.Run.run(Run.java:1376)

推荐答案

Gerrit插件页面上描述了一些技巧:

There is trick described on the Gerrit plugin page:

通常,当您配置了要由Gerrit触发的作业时,就不能再使用立即构建"链接,因为您的构建依赖于Gerrit的信息,尤其是如果您使用Git插件在工作区.

Normally when you have configured a job to be triggered by Gerrit you can't use the "Build Now" link anymore since your builds are dependent on information from Gerrit, especially if you are using the Git plugin to checkout your code in the workspace.

例如,如果您想在某个时候使用同一作业来构建master分支,则可以绕开此限制.如果您使用的是Git插件,请执行以下操作

You can get around this limitation if you for example want to use the same job to build the master branch at some point. If you are using the Git plugin do the following

添加一个名为GERRIT_REFSPEC的字符串参数,其默认值为refs/heads/master

Add a String parameter called GERRIT_REFSPEC with the default value refs/heads/master

使用此技巧可以使您进行构建,但是由于titit不会触发该结果,因此不会将任何结果发送给Gerrit.

Using this trick will enable you to build, but no results will be sent to Gerrit since tit is not triggered by it.

这篇关于Jenkins:Gerrit触发器问题的设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆