Jenkins relies on tags with a gerrit-trigger plugin

I have a Jenkins server that runs the Gerrit trigger plugin for continuous integration. To run unit tests and style checks, it works fantastic!

However, I am interested in using Jenkins to create our deployment packages.

Ideally, developers will click tags on Gerrit, and the gertrit-trigger plugin will notify Jenkins of the creation of tags and their proper deployment.

Is there a way to configure this through jenkins and gerrit, instead of using intercepts in the Gerrit git repos to post to the Jenkins REST API or using wasteful logarithmic SCM polling?

I suspect there might be a way to do this, but I'm not quite sure where to start.

+4
source share
2 answers

The Gerrit launch plugin has several launch options for launching a job.

In your Jenkins work under the Gerrit Trigger section, you will find the Trigger On section with a drop-down list. If you activate "Ref updated", it will start your work at any time when the developer directly redirects the link to Gerrit without going through the review process. This will not be strictly limited to tag events, but he will catch them.

+7
source

"Ref update" works, but is also triggered by a commit combined with the master. If you just want the assembly to be called by new tags. Try the next step:

1, the tag must be in the form, for example release / xxx.xx.xx

2, Git plugin Configuration: Repository URL: ssh: // xxxx@mygerrit.com : 29418 / sweetTest.git Branches: master

3, Gerrit plugin: Select "Gerrit Event" Select "Refresh" Fill Gerrit project Templates: Normal : sweetTest Branches: Path : refs / tags / release / *

4 Now click on the new "release / tagName" tag on the remote branch of the gerrit replica master server, invoking the assembly

+5
source

Source: https://habr.com/ru/post/1500576/


All Articles