withEnv takes an array parameter.
So something like:
withEnv(['AAA=blah', 'BBB=bill]) {
sh 'echo $AAA and $BBB'
}
Should work. Can't check easily now from the phone.
My 2 cents
Le 1 sept. 2017 10:09 AM, "Esdras Neto" <[email protected]> a écrit :
Hi there,
I was using load to set my variables and it was working fine, however, this
wont work with multiple jobs running in parallel.
How can I set a bunch of system variables using withEnv and reuse the code?
I tried:
def LNX_VARS = '''PATH=/path/to/ant/bin:/usr/bin:/sbin',
'JAVA_HOME=/path/to/my/java''''
And then:
withEnv (LNX_VARS) {
sh 'ant -v'
}
Is there any documentation about using multiple system variable lines with
withEnv?
Thanks!
Esdras
--
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/f294dfc5-d44a-4d32-a277-db849c69c8fc%40googlegroups.
com
<https://groups.google.com/d/msgid/jenkinsci-users/f294dfc5-d44a-4d32-a277-db849c69c8fc%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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/CANWgJS7XYXOQcSzz8U_yyBW8-6P_g%3D6f-e9CcBVXhh%3D%2B_c%2BMsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.