rodee
rodee

Reputation: 3171

Inject all GERRIT env variables as if the Jenkins job was started by gerrit event

This SO answer has the list of environment variables which gets injected automatically when a Jenkins job is triggered by a gerrit event, but if Jenkins is started manually with a gerrit number as input parameter, how to fetch those GERRIT_* env variables and inject? so the list of environment variables will be same for job started by gerrit event or started manually with gerrit number as input parameter.

Upvotes: 0

Views: 489

Answers (1)

You can't do that easly, you would have to use the REST API to search for the GERRIT_* values you're interested in.

But there's another option that, maybe, can solve your problem:

You can re-trigger any job, as it had been trigged at that moment, with all environment variables set. Do the following:

  • Go to Jenkins web interface
  • Click on Jenkins > Query and Trigger Gerrit Patches
  • Search/select the Changes/Patchsets you want
  • Click on Trigger Selected

Upvotes: 1

Related Questions