I have got a FreeStyle project in Jenkins. One part of the build is an "Execute Groovy script" build step (important: not an 'Execute System Groovy script' step - that would not work).
The calculations the script does are needed later on in other build stepes. How can I use variables along all steps? Is there a possibility to set environment variables in the "Execute Groovy script" that will be extracted later?
I already tried to use
import hudson.EnvVars
import hudson.model.*;
...
def envvars = ['envVarName': 'envVarValue']
build.environments.add(0, Environment.create(new EnvVars(envvars)))
but 'build' cannot be found in non-system groovy steps.
Any ideas?
Thanks a lot :) ian