Thanks Robert, the problem was that I had no top level agent. Works ok now.

Best regards

David

From: [email protected] 
[mailto:[email protected]] On Behalf Of Robert Hales
Sent: 22 September 2017 03:28
To: Jenkins Users <[email protected]>
Subject: Re: Problem with environment variable in declarative script

Either the syntax checker isn't smart enough, or the variables aren't available 
like that until you get down into the stages. I am suspecting the former, but 
just a guess.

This syntax should work fine, though:

SCRIPTS_PATH = "${env.WORKSPACE}/tools/Jenkins/PythonScripts"



On Thursday, September 21, 2017 at 9:48:43 AM UTC-6, David Aldrich wrote:
Hi

My Jenkinsfile contains:

    environment {
       SCRIPTS_PATH="${WORKSPACE}/Tools/Jenkins/PythonScripts"
    }

When the script runs I get exception:

groovy.lang.MissingPropertyException: No such property: WORKSPACE for class: 
groovy.lang.Binding
        at groovy.lang.Binding.getVariable(Binding.java:63)

How should I correct the syntax?

Best regards

David

--
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]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/482db132-c078-4815-ada3-e98b8b79404b%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/482db132-c078-4815-ada3-e98b8b79404b%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.


Click 
here<https://www.mailcontrol.com/sr/Ai9GSl2BJW7GX2PQPOmvUnR5FqKQsdnp08!gR9OEhVuUN8Sp!2jjbJ5fRyVTjafn954Li9706+urbIY9K1KtKg==>
 to report this email as spam.

-- 
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/108e52d84a814fd4a309583471997a2f%40EUX13SRV1.EU.NEC.COM.
For more options, visit https://groups.google.com/d/optout.

Reply via email to