Tracking build failure in the custom pipeline wrapper step

15 views
Skip to first unread message

Artyom Melnikov

unread,
Jul 19, 2017, 6:36:03 AM7/19/17
to Jenkins Users
Hello. I am trying to create my own pipeline step plugin. What i want to achieve is:
node {
    mystep
(var: ...) {
       
...
        sh
"gradle clean build"
       
...
   
}
}

The key point here: i need to track the status of the inner steps (gradle build in this case) and execute some code based on the result. Currently i extended SimpleBuildWrapper and set Disposer:
context.setDisposer(new Disposer() {
       
@Override
       
public void tearDown(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener)
               
throws IOException, InterruptedException {
           
...
       
}
   
});

But the issue here: i have no idea how to track inner steps result here. When disposer code executed build status is still 'RUNNING', even though gradle build finished with exception. 

Is there any way to track inner step's result at the end of my wrapper step? 

Michael Pailloncy

unread,
Jul 19, 2017, 6:34:59 PM7/19/17
to jenkins...@googlegroups.com
Hello, I think this question is more related to the jenkin...@googlegroups.com mailing list instead of this one. You'll have better chance of result IMHO :-)

--
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 jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/8f8e59ac-2d0e-4391-a4a8-1196ab973639%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages