u123
u123

Reputation: 16325

Pass command line arguments to Gerrit and Jenkins

On Jenkins I have a maven job that I have configured using the gerrit trigger/event. Each time a change is pushed to the gerrit git repo the job is started automatically.

I have added a maven build profile to the job called functional_test which runs more tests and therefore takes longer time.

Now I would like to control if the profile should be activated or deactivated when a push is made to gerrit.

Is it somehow possible to pass parameters to gerrit when doing a push that either passes these parameters to the jenkins job or triggers another job which have the profile activated - would prefer the former?

Here it seems that they pass parameters in the commit message: https://wiki.hpdd.intel.com/display/PUB/Changing+Test+Parameters+with+Gerrit+Commit+Messages

but its not documented how the parameters are parsed from there

Upvotes: 0

Views: 1071

Answers (1)

Malatesh
Malatesh

Reputation: 1954

You can configure environmental variables in job configurations. In our project we have done like key=value export key our ant targets reads this value. this may help you

Upvotes: 0

Related Questions