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
Hi all,
on a remote node I have a file that exports some variables:
$ cat myenv
export FOO=Hello
export BAR=World
My pipeline script tries to source that file, but the variables don't seem
to stick:
node ('remote-server') {
sh ('. /home/cmr/myenv')
echo "My Variables: ${env.FOO}
Beck wrote:
>
>
> > On 31. Oct 2017, at 22:51, Christoph Ruepprich <cruep...@gmail.com
> > wrote:
> >
> > This gets pretty tedious and time consuming. Is there a better way to
> develop scripts without having to either develop them in the web UI or copy
>
nd make small
> modifications to the script that was used to test things out, then you can
> incorporate those changes into your Jenkinsfile.
>
> Hope those things help
>
> Alex
>
> On Tue, Oct 31, 2017 at 2:51 PM Christoph Ruepprich <cruep...@gmail.com
> &g
I'm new to Jenkins and am learning how to write groovy scripts for
pipelines. Right now I write my code in VS Code and copy & paste it into
the Jenkins' project, save and build. This gets pretty tedious and time
consuming. Is there a better way to develop scripts without having to
either
he declarative framework and converting to a straight
> groovy script.
>
>
> On Tuesday, October 31, 2017 at 8:37:24 AM UTC-6, Christoph Ruepprich
> wrote:
>>
>> Looking at some pipeline scripting examples, I see that there are two
>> different ways to script
Looking at some pipeline scripting examples, I see that there are two
different ways to script a pipeline. One begins with pipeline {} the other
with node {}. What is the difference between the two, and when would I use
one or the other?
thanks,
C
--
You received this message because you are