Re: Pipeline: Fails reading build cause

2016-06-21 Thread Antonio Muñiz
You need to do all the work with non-serializable objects inside the @NonCPS annotated function and return a serializable object. In your example you are storing the result of `getLastBuildCause` outside the non-cps function. Try return a `String` there. On Tue, Jun 21, 2016 at 8:32 AM, Sverre Mo

Re: Pipeline: Fails reading build cause

2016-06-20 Thread Sverre Moe
I found a JENKINS issue dealing with NonCPS https://issues.jenkins-ci.org/browse/JENKINS-31314 Tried the suggestion in the last comment and only call the NonCPS methods from the master node. Seems I really need to define a heavyweight executor on the master. Reading the build cause on a flyweigh

Pipeline: Fails reading build cause

2016-06-20 Thread Sverre Moe
I have tried reading the build cause as suggested in this example https://github.com/jenkinsci/pipeline-examples/tree/master/pipeline-examples/get-build-cause Accessing the build cause outside of a node causes the pipeline to fail right after entering the first stage and without an error or excep