Hi,
I'm using the build flow in my jobs and I would like to get any build
result from build object even if the build is failed or unstable.
For example:
try{
BUILD_TO_RETURN = build(parameters: newparams, job: jobName, quietPeriod
: 5);
println("Result is: " + BUILD_TO_RETURN.getResult()); // THIS LINE IS
NOT BEING CALLED IF THE BUILD IS UNSTABLE
}
catch(Exception e)
{
if (e instanceof InterruptedException || e.getCause() instanceof
InterruptedException) {
throw e;
}
else if( e.toString().contains("UNSTABLE") ||
e.toString().contains("FAILURE")){
println("buildJob : No exception, the job result: ${e}"); // THIS
LINE IS BEING CALLED
return BUILD_TO_RETURN;
}
What actually happening is that BUILD_TO_RETURN returned is null. Which
means an exception was thrown for UNSTABLE build.
I would like rather to have the UNSTABLE build object in my hands and
return it.
Is it possible to "ignore" failure\unstable build and do not ignore all
other exceptions?
Thanks,
Valeriy
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/6bafe3e3-380e-4463-adcb-c3067d8162ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.