6

I have a Jenkins server running the Gerrit trigger plugin for continuous integration. For running unit tests and style checks, it's working fantastically!

However, I'm interested in using Jenkins to build our deployment packages as well.

Ideally, developers would push tags to Gerrit, and the gerrit-trigger plugin would notify Jenkins to build the tags, and deploy them appropriately.

Is there some way to configure this through jenkins and gerrit, rather than using hooks in Gerrit's git repos to post to Jenkins's REST API, or using wasteful laggy SCM polling?

I suspect that there may be a way to do this, but I'm not quite sure where to begin.

4

2 回答 2

8

Gerrit 触发器插件有几个用于启动作业的触发器选项。

在您的 Jenkins 工作中,在“Gerrit Trigger”下,您会找到带有下拉列表的“Trigger On”部分。如果您触发“Ref updated”,只要开发人员将 ref 直接推送到 Gerrit,它就会运行您的工作,而无需经过审核流程。这不会严格限于标记事件,但它会捕获它们。

于 2013-09-04T19:58:46.807 回答
6

“参考更新”有效,但它也由合并到主控的提交触发。如果您只想让新标签触发构建。尝试以下步骤:

1、标签格式为release/xxx.xx.xx

2、Git插件配置:Repository URL:ssh://xxxx@mygerrit.com:29418/sweetTest.git 要构建的分支:master

3、Gerrit插件:选择“Gerrit event” 选择“Ref updated” 填写Gerrit项目 Patterns: Plain : sweetTest Branches: Path : refs/tags/release/*

4、现在将新标签“release/tagName”推送到远程gerrit repo master分支将触发构建

于 2014-02-06T14:44:29.320 回答