I am trying to read the environment variables in Groovy Postbuild step. I am able to read the values of parameters passed to builds but unable to read the values of parameters which are set in one of my Execute Windows batch command
.
In one example of my Execute Windows batch command
I do this:
SET custom_param=myValue
if I use ${custom_param}
in other jenkins steps/jobs, it gets my value. So I am sure it has the value. I just can't get it in groovy script
I have tried followings to do so, none of them have worked:
- manager.envVars['custom_param']
- build.buildVariableResolver.resolve('custom_param')
- build.getEnvironment(listener).get('custom_param')
Any help here would be great