sure, rescue handle whatever happens in gard block, that has no restriction
on nested content

2013/1/3 Patrick van der Velde <petrikvanderve...@gmail.com>

> Thanks for that suggestion. One question about the guard statement. Can it
> handle multiple statements? i.e. is the following allowed?
>
> guard {
>     build("job1")
>     build("job2")
> } rescue {
>     build("finaljob")
> }
>
> or even this
>
> guard {
>     parallel(
>         { build("job1a") },
>         { build("job2a") },
>     )
>
>     parallel(
>         { build("job1b") },
>         { build("job2b") },
>     )
> } rescue {
>     build("finaljob")
> }
>
> My script looks a bit like that last one but when I tried putting a guard
> clause around it I got the following error:
>
>
> ERROR: Failed to run DSL Scriptgroovy.lang.MissingMethodException 
> <http://stacktrace.jenkins-ci.org/search?query=groovy.lang.MissingMethodException>:
>  No signature of method: com.cloudbees.plugins.flow.FlowDelegate.rescue() is 
> applicable for argument types: (Script1$_run_closure1_closure3) values:
>
>
> Removing the guard clause made it work. So I'm guessing guard can only
> handle 1 item?
>
> Thanks
>
> Petrik
>
>
> On Wed, Jan 2, 2013 at 10:16 PM, nicolas de loof <nicolas.del...@gmail.com
> > wrote:
>
>> use gard+rescue so you can execute a post-job even when some jobs are
>> unstable
>>
>>
>> 2013/1/2 Patrick <petrikvanderve...@gmail.com>
>>
>>> Ok I'm going to have to amend this answer. My idea of having a separate
>>> job at the end to gather the results would work if it wasn't for the fact
>>> that the build flow plugin kills the build as soon as one of the jobs
>>> fails. That means I only can get the results if the build works which is
>>> not what I want. I want the results gathering to always take place, even if
>>> the all the build jobs fail. Any way to achieve this?
>>>
>>> Thanks
>>>
>>> Petrik
>>>
>>>
>>> On Wednesday, 2 January 2013 11:46:54 UTC+13, Patrick wrote:
>>>>
>>>> Hi
>>>>
>>>> Mmm ok, I guess I could create a separate job to gather all the test
>>>> results. Thanks for the advice :)
>>>>
>>>> Regards
>>>>
>>>> Petrik
>>>>
>>>>
>>>>
>>>>
>>
>

Reply via email to