Thanks, Jesse

I will try and understand this. however first few attempts always showed 
below exception when i invoked my pipeline step as 
runMATLABCommand "Command" 
java.lang.IllegalStateException: There is no body to invoke
at 
org.jenkinsci.plugins.workflow.cps.CpsStepContext.newBodyInvoker(CpsStepContext.java:282)

Meanwhile, I found out this 
https://github.com/jenkinsci/workflow-durable-task-step-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/steps/durable_task/DurableTaskStep.java

This works perfectly fine with *BourneShellScript * class invocation 
however  I am kind of stuck at figuring out the cleanup activities 
after execution is done (like deleteing all temp folders and files i 
created) Class *DurableTask *does not seem to have a way to override 
cleanup() method. any idea on how we could do the cleanup after *public 
Controller launch(EnvVars env, FilePath workspace, Launcher launcher,*
*            TaskListener listener) throws IOException, 
InterruptedException{} *method gets executed.

Thanks & Regards
Nikhil

On Monday, 27 July 2020 at 21:35:37 UTC+5:30 Jesse Glick wrote:

> On Fri, Jul 24, 2020 at 9:14 AM Nikhil Bhoski <[email protected]> wrote:
> > SynchronousNonBlockingStepExecution works perfectly fine
>
> …until you restart Jenkins, at which point your build will fail. So do
> not do this.
>
> > i went through ant plugin code but i could not find the reference of 
> getContext().newBodyInvoker()
>
> Sorry, that was a `SimpleBuildWrapper` actually. Try:
>
>
> https://github.com/jenkinsci/groovy-plugin/pull/22/files#diff-50f6bc8a021eb526aa29d3be83dc8e0bR148
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" 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-dev/a9701559-25ad-45b7-8760-3f9c5876c0dfn%40googlegroups.com.

Reply via email to