Here is my FlowScript. `dev.AlwaysFail` is job that will always fail.
def afterFail=false;
def afterFail_2= false;
guard {
b = build( "dev.AlwaysFail" )
out.println ("must not appear") //executed even after the error.
afterFail = true; //executed even after the error.
b = build( "dev.AlwaysFail" )
afterFail_2 = true;
} rescue {
out.println afterFail
out.println afterFail_2
}
Result from execution
=============
guard {
Schedule job dev.AlwaysFail <http://localhost:8080/job/dev.AlwaysFail/>
Build dev.AlwaysFail #3 <http://localhost:8080/job/dev.AlwaysFail/3/>
started
dev.AlwaysFail #3 <http://localhost:8080/job/dev.AlwaysFail/3/> completed
: FAILURE
must not appear
} rescue {
true
false
}
Finished: FAILURE
=====================
Is there a way to directly execute "guard" when build triggered from flow
execute?
Thanks,
Jayan
--
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/3a5b966a-410d-4ea1-ba1c-da8e9cb93083%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.