many parallel stages

27 views
Skip to first unread message

Chris Overend

unread,
Jun 5, 2017, 12:29:53 PM6/5/17
to Jenkins Users
Hello,
I was looking for help with a many parallel pipeline.
Here is what I am looking to do

parallel(
   
'linux': {
        stage
('build_linux') {
            build job
: 'linux_build', parameters:[]
            build job
: 'linux_archive', parameters:[]
           
parallel(
                stage
('test1_linux') {
                    build job
: 'test1_setup1', parameters:[]
                    build job
: 'test1_setup2', parameters:[]
                   
parallel(
                        many_builds
...
                   
)
                    build job
: 'test1_finish', parameters:[]
               
}
                stage
('test2_linux') {
                    build job
: 'test2_setup1', parameters:[]
                    build job
: 'test2_setup2', parameters:[]
                   
parallel(
                        many_builds
...
                   
)
                    build job
: 'test2_finish', parameters:[]
               
}
           
)
       
}
   
},
   
'windows': {
        stage
('build_windows') {
            build job
: 'windows_build', parameters:[]
            build job
: 'windows_archive', parameters:[]
           
parallel(
                stage
('test1_windows') {
                    build job
: 'test1_setup1', parameters:[]
                    build job
: 'test1_setup2', parameters:[]
                   
parallel(
                        many_builds
...
                   
)
                    build job
: 'test1_finish', parameters:[]
               
}
                stage
('test2_windows') {
                    build job
: 'test2_setup1', parameters:[]
                    build job
: 'test2_setup2', parameters:[]
                   
parallel(
                        many_builds
...
                   
)
                    build job
: 'test2_finish', parameters:[]
               
}
           
)
       
}
   
}
)

As you see most pieces are the same so I tried something like

parallel(
   
'linux': {
        generate_build
('linux')
        parallel
(
            generate_tests
('test1')
            generate_tests
('test2')
       
)
   
},
   
'windows': {
        generate_build
('windows')
        parallel
(
            generate_tests
('test1')
            generate_tests
('test2')
            generate_tests
('test3')
            generate_tests
('test4')
       
)
   
},
)

def generate_build(system) {
    build job
: system + '_build', parameters:[]
    build job
: system + '_archive', parameters:[]
}

def generate_tests(tests) {
    build job
: tests + '_setup1', parameters:[]
    build job
: tests + '_setup2', parameters:[]
        parallel(
            many_builds
...
         
)
     build job
: tests + '_finish', parameters:[]
}

the generate_build ran in parallel , but the generate_tests did not run in parallel

should I be using a map of maps?

Artur Szostak

unread,
Jun 6, 2017, 4:23:26 AM6/6/17
to Jenkins Users
From what I understand neither concurrent stages nor stages embedded in stages are supported.
I think you can only have parrallel within a stage block. But not the other way around.

________________________________________
From: jenkins...@googlegroups.com <jenkins...@googlegroups.com> on behalf of Chris Overend <chris....@vectorcast.com>
Sent: 05 June 2017 18:29:53
To: Jenkins Users
Subject: many parallel stages
--
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 jenkinsci-use...@googlegroups.com<mailto:jenkinsci-use...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/32f034ba-70d4-4812-b63b-213827169081%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/32f034ba-70d4-4812-b63b-213827169081%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages