Hi,

I'm trying to configure an environment variable during the Pipeline that
later on should be
expanded by Gerrit Trigger Plugin. I've tried to implement
EnvironmentContributingAction
and add it to currentBuild.rawBuild object but it seems like it doesn't do
the job.
I've also tried to import the implementation of
EnvironmentContributingAction from
EnvInject plugin without success as well.

Here is an example of what I've tried to do:

I've configured a variable named "MY_VAR" using EnvInject plugin and tried
to modify it
during the build. Then, I'd expected to see the updated value when printing
the environment
but changes don't seem to take effect.


import org.jenkinsci.plugins.envinject.*
import hudson.model.*

Map<String, String> m = new HashMap<String, String>()
m['MY_VAR'] = 'VAL'

def build = currentBuild.rawBuild
build.addAction(new EnvInjectPluginAction(m))
println(build.getEnvironment())


Maybe someone encountered a similar issue before and can share some
experience?
Or am I doing something wrong here?

Thanks,
Daniel.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAGo3s3wzORDpMCXE__MPGVk1z%3D70Ewd4oNCpO%3D16pK0jBn-6_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to