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.
Asked
Active
Viewed 409 times
1 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

Marcelo Ávila de Oliveira
- 19,950
- 3
- 39
- 50