简体   繁体   中英

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:

  • Be triggered by a Gerrit event of "Patchset Created" (works)
  • Then fetch the specific change from Gerrit (works)
  • 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 and . 根据文档配置触发器插件时,我不知道如何配置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. 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?

Gerrit-Trigger plugin is not intended for merging other branches -
should use your won script for that (which you can trigger as a different Jenkins-job).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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