Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins builds on tag pushes via gerrit-trigger plugin

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.

like image 603
gepoch Avatar asked Sep 04 '13 16:09

gepoch


1 Answers

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.

like image 142
AusIV Avatar answered Oct 24 '22 06:10

AusIV