Gerrit Trigger if commit message contains regular expression

28 views
Skip to first unread message

Bassam Khouri

unread,
Oct 28, 2020, 6:47:52 PM10/28/20
to jenkin...@googlegroups.com
Hi,

I have a need where I want the Gerrit Trigger plugin to trigger Jenkins job if the commit message matches a regular expression.  I didn't find a Jira in the project and was thinking of implementing it, however I'm not sure how it should look in the UI, nor all other use cases.

I'm new to Jenkins plugin development and am wondering if someone can provide guidance as to how I should proceed to ensure I develop and test the changes against all possible scenarios.

The project github page does provide any documentation on setting up the dev environment. 

  • Is the developer environment something trivial?  how would I test my local plugin changes against a local Jenkins instance?
  • Can someone offer some guidance on how I am to proceed to add the "Commit message contains" functionality? 

Thanks in advance,

Bassam

Gavin Mogan

unread,
Oct 28, 2020, 8:03:59 PM10/28/20
to Jenkins Developers
> Is the developer environment something trivial?  how would I test my local plugin changes against a local Jenkins instance?

Generally yes. The parent pom file could be more modern (top of the pom file), but i think 3.x is modern enough. You should just be able run `mvn hpi:run` and it'll spin up an instance. 

As for how, thats a little harder. You'll either want to create or extend a descriptor. If you create you'll probably need a config.jelly, if you extend, you need to find the related jelly file. I would guess what your trying to do is add configuration to something that already exists, so you'll probably just want to look for the descriptor in the related class.

Gavin

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAPeymodtrMV1EpJe3nbQQH8TBjuuiqrRfkje%3Da-jtmfpY2RXdg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages