Moving the thread to Jenkins user list

Sound like you have more or less what I have.  But for easy access console
of the different jobs see the bottom part.


builds = []
ignore(FAILURE) {
    parallel (
       { builds.add(build("foo1",
                                    COPY_PATH :   params["bar"])) },
       { builds.add(build("foo2",
                                    COPY_PATH :   params["bar"])) },
       { builds.add(build("foo3",
                                    COPY_PATH :   params["bar"])) },
    )
}

for (b in builds) {
     out.println "Finished Build : " +
                      hudson.console.HyperlinkNote.encodeTo("/" +
b.getUrl(),

            String.valueOf(b.getDisplayName())) +
                      " of Job : " +
                      hudson.console.HyperlinkNote.encodeTo('/' +
b.getProject().getUrl(),

             b.getProject().getFullName()) +
                      " with status :" +
                      hudson.console.HyperlinkNote.encodeTo('/' +
b.getUrl() + "console",

             b.getResult().toString())

    build.setResult(build.getResult().combine(b.getResult()))
}

Regards,
Asmund


On Thu, Jun 20, 2013 at 5:01 PM, pawelrychlik <[email protected]>wrote:

> Thanks for your reply.
>
> Actually, I have a slightly more complex script, and I've made it out
> combining the partial results (Result#combine() and #isBetterOrEqualTo()
> helped a lot) and throwing exceptions after the final sum up (if suitable).
>
>
>
> On Thursday, June 20, 2013 3:22:42 PM UTC+2, nicolas de loof wrote:
>
>> this is not implemented and will not be as is.
>> looks like what you want is
>>
>> guard {
>>     parallel ([
>>         t1: { build("something") },
>>         t2: { build("something else") }
>>     ])
>> } rescue {
>>     build("blab")
>> }
>>
>>
>>
>> 2013/6/20 pawelrychlik <[email protected]>
>>
>>> What's the proper way to set the exit code or return value of the groovy
>>> DSL job in Build Flow Plugin?
>>>
>>> I've came up with such a dirty quick script - so that you could see the
>>> context:
>>>
>>> ignore (FAILURE) {
>>>     temp = parallel ([
>>>         t1: { build("something") },
>>>         t2: { build("something else") }
>>>     ])
>>>    first_result = SUCCESS == temp.t1.getResult() && SUCCESS ==
>>> temp.t2.getResult()
>>> }
>>>
>>> ignore (FAILURE) {
>>>     temp = build("blab")
>>>     second_result = SUCCESS == temp.getResult();
>>> }
>>>
>>> if (first_result && second_result) {
>>>     return; // return [whatever] always means SUCCESS
>>> } else {
>>>     // TODO how to set the exit code to FAILURE?
>>>     throw new Exception("Fail!")
>>> }
>>>
>>> Is this feature not implemented in Build Flow Plugin, or am I missing
>>> something?
>>>
>>> thx in advance,
>>> PR
>>>
>>>  --
>>> 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 jenkinsci-de...@**googlegroups.com.
>>>
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>
>>  --
> 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 [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to