Hello,

I have an old groovy script that I've been using to inject some env. 
variables into the job. It run nicely under Jenkins 1.x, on the master 
Jenkins instance.
Now we've moved to a Jenkins cluster and Jenkins 2.x and the script fails 
to get a valid workspace for the current build (the job always executes on 
the same Windows slave).

This is the error:
- when isDebugMode = false

FATAL: Current build workspace is null! java.lang.Exception 
<http://stacktrace.jenkins-ci.org/search?query=java.lang.Exception>: Current 
build workspace is null!

- when isDebugMode = true and I run the script in the Scriptler console
java.lang.NullPointerException: Cannot invoke method getLastSuccessfulBuild() 
on null object


This is the script: 
https://gist.github.com/savornicesei/c9dbafec8339b1e8d18c1d4a6e620baa

As a side question, I noticed lots of methods and classes are deprecated 
from Hudson.* packages. As a best practice, should I use only the jenkins.* 
packages in the groovy scripts?

Thanks.

-- 
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/5422d876-ca13-49ef-b542-407f98d28439%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to