As far as I know, *stage* blocks inside parallel tasks are deprecated =>
see
https://github.com/jenkinsci/pipeline-examples/blob/master/docs/BEST_PRACTICES.md#parallelism

Have you tried something like :


stage ("Setup") {
    parallel (
        'xenial': {
            node("xenial") {
               sh 'echo xenial setup'
            }
        },
        'trusty': {
            node("trusty") {
               sh 'echo trusty setup'
            }
        }
    )
}
stage ("Build") {
    parallel (
        'xenial': {
            node("xenial") {
               sh 'echo xenial build'
            }
        },
        'trusty': {
            node("trusty") {
               sh 'echo trusty build'
            }
        }
    )
}

IIUC, this pipeline should do what you want.

If not, have you tried to create your pipeline with BlueOcean Pipeline
Editor Plugin ?


2017-07-03 12:50 GMT+02:00 Leandro Lucarella <
[email protected]>:

> Hi, I'm trying to build a pipeline that in principle it sounds like it
> should be very simple. I basically have a project that I want to build
> and test for Ubuntu trusty and xenial. So basically I want to run them
> in separate nodes (which will use Docker).
>
> I want to visualize this in blueocean like this:
>
>   Checkout    Build     Test    Deploy
>
>      O----------O--------O--------O
>   trusty     trusty   trusty   trusty
>
>      O----------O--------O--------O
>   xenial     xenial   xenial   xenial
>
> But I can't nail it. TL;DR, is there any way to achieve this? If yes,
> how? If not, is it planned? If yes, any ETAs?
>
> Things that I tried:
>
> I can run 2 "jobs" in different nodes completely in parallel, but then
> stages inside the nodes are not visualized:
>
> parallel(
>     'xenial': {
>         node {
>             stage("Setup") {
>                 sh 'echo xenial setup'
>             }
>             stage("Build") {
>                 sh 'echo xenial build'
>             }
>         }
>     },
>     'trusty': {
>         node {
>             stage("Setup") {
>                 sh 'echo trusty setup'
>             }
>             stage("Build") {
>                 sh 'echo trusty build'
>              }
>         }
>     }
> )
>
> This shows:
>
>     Parallel
>
>         O
>       xenial
>
>         O
>       trusty
>
> If I add top-level stages outside of the node{}, then I get a closer
> visualization, but then both track don't run completely in parallel:
>
> stage ("Setup") {
>     parallel (
>         'xenial': {
>             node {
>                 stage("Run") {
>                     sh 'echo xenial setup'
>                 }
>             }
>         },
>         'trusty': {
>             node {
>                 stage("Run") {
>                     sh 'echo trusty setup'
>                 }
>             }
>         }
>     )
> }
> stage ("Build") {
>     parallel (
>         'xenial': {
>             node {
>                 stage("Run") {
>                     sh 'echo xenial build'
>                 }
>             }
>         },
>         'trusty': {
>             node {
>                 stage("Setup") {
>                     sh 'echo trusty build'
>                 }
>             }
>         }
>     )
> }
>
> And on top of not being really parallel, the synchronization points are
> shown in the visualization (which makes sense if there are
> synchronization points:
>
>   Checkout         Build           Test          Deploy
>      O-----.--.------O-----.-.------O-----.-.------O
>   trusty   | |    trusty   | |   trusty   | |   trusty
>            | |             | |            | |
>      O----´   `-----O-----´   `-----O-----´ `------O
>   xenial         xenial          xenial         xenial
>
>
> So, questions again for the people that read this far :)
> Is there any way to achieve this? If yes, how? If not, is it planned?
> If yes, any ETAs?
>
>
> Thanks a lot!
>
> --
> Leandro Lucarella
> Technical Development Lead
> Sociomantic Labs GmbH <http://www.sociomantic.com>
>
> --
> 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/20170703125023.20deb51c%40labs-064.localdomain.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAPO77c3pHrO9pQYTrkLtCjh40Yrb7bBntY7zP%3DJQxiUqzFqeZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to