Tracking build failure in the custom pipeline wrapper step

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Tracking build failure in the custom pipeline wrapper step

Artyom Melnikov
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 (i.e. track if gradle build failed) . 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? 

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/71e0e646-6d36-4300-8e79-e8cbfc758325%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tracking build failure in the custom pipeline wrapper step

Jesse Glick-4
On Thu, Jul 20, 2017 at 3:08 AM,  <[hidden email]> wrote:
> Is there any way to track inner step's result at the end of my wrapper step?

Not using `SimpleBuildWrapper`. If you make a first-class `Step` you
have more flexibility.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr3Mvn4KuHJS%2Btw-zgXj94HuiNyfphDEvOZbEbhJPQzY8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.