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?