It states here:
https://github.com/jenkinsci/workflow-plugin/blob/master/TUTORIAL.md
that:
"environment variable overrides are currently limited to being global to a workflow run, not local to the current thread (and thus slave)."
Until this changes, what is the recommended approach?
Just collect them and add them to every sh command?
like this:
def localEnv = []
def golang = tool name: 'Go 1.2.2', type: 'org.jenkinsci.plugins.golang.GolangInstallation'
localEnv.add("export GOROOT=${golang}")
localEnv.add("export PATH=\$PATH:${golang}/bin")
...
sh localEnv.join("\n") + "go build ...."
Cheers,
tim