Still stuck here, is there a way to reuse blocks of code as variable in the 
pipeline?

I can see in the logs that the variable is passed, but we get errors like:

java.lang.NoSuchMethodError: No such DSL method 'withEnv(['


This time I tried to make a variable with the whole thing (not only the 
variables but the withEnv command as well).


Any light?


Thanks!



Il giorno venerdì 1 settembre 2017 09:09:33 UTC+1, Esdras Neto ha scritto:
>
> 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/5eb0cd3d-fa71-4d7a-8129-6fe3c4cd2d8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to