Thanks ichymuzzle. It worked with a minor change.
So the problem is that each sh looses it's environment. Is there a way to 
set it globally?


node ('remote-server') {
    sh ('''
       . /home/cmr/myenv
       echo "My Variables: $FOO $BAR"
    ''')
}



On Thursday, 2 November 2017 14:01:04 UTC-5, itchymuzzle wrote:
>
> Maybe something like this?
>
> node ('remote-server') {
>     sh '''
>        . /home/cmr/myenv'
>        echo "My Variables: ${env.FOO} ${env.BAR}"
>     '''
> }
>

-- 
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/892167f5-00f0-43be-ac79-20eb6dec8bfd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to