简体   繁体   English

如何配置Jenkins Gerrit触发插件进行预合并

[英]How to Configure Jenkins Gerrit Trigger Plugin to do a premerge

I am stuck for some hours now, trying out how to configure my Jenkins verification-job to do the following: 我现在呆了几个小时,尝试如何配置我的Jenkins验证作业以执行以下操作:

  • Be triggered by a Gerrit event of "Patchset Created" (works) 由“补丁集已创建”的Gerrit事件触发(有效)
  • Then fetch the specific change from Gerrit (works) 然后从Gerrit获取特定更改(有效)
  • Merge/rebase the current change to the most recent origin/master (does not work) 将当前更改合并/重新设置为最新的原件/原件(无效)
  • Perform the build (works) 执行构建(工作)

As you can see I don't know how to configure the Job to make sure, the origin/master branch is allways the very recent version, when I configure the Trigger Plugin according to the documentation, using GERRIT_REFSPEC and GERRIT_BRANCH . 如您所见,当我根据文档使用GERRIT_REFSPECGERRIT_BRANCH根据文档配置触发器插件时,我不知道如何配置Job以确保源/主分支始终是最新版本。

As our project has several branches, I do not want to fetch them all in the job, just to be able to do a merge on the most recent origin/master. 由于我们的项目有多个分支,因此我不想在工作中全部取走它们,而只是想对最新的原件/母版进行合并。 I tried to do some concatenated Refspec like origin/master:refs/remotes/origin/master,GERRIT_BRANCH but this did not work. 我试图做一些串联的Refspec,例如origin / master:refs / remotes / origin / master,GERRIT_BRANCH,但这没有用。 In other words, what I would like to do is: 换句话说,我想做的是:

Be triggered by the change, fetch the change, fetch the most recent master, do the rebase/merge and then build. 由更改触发,获取更改,获取最新的主服务器,进行变基/合并,然后构建。 Can this be done with the plugin's form, or would I have to do some manual GIT commandline acrobatics? 可以使用插件的形式完成此操作,还是我必须做一些手动的GIT命令行技巧?

Gerrit-Trigger plugin is not intended for merging other branches - Gerrit-Trigger插件不适用于合并其他分支-
should use your won script for that (which you can trigger as a different Jenkins-job). 应该使用您的赢脚本(您可以将其作为另一个詹金斯职位触发)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM