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.
The Gerrit trigger plugin has several trigger options for initiating the job.
In your Jenkins job, under "Gerrit Trigger" you'll find a "Trigger On" section with a drop-down list. If you trigger on "Ref updated" it will run your job any time a developer pushes a ref directly to Gerrit without going through the review process. This won't strictly be limited to tag events, but it will catch them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With