Job DSL - Multijob iteration?

37 views
Skip to first unread message

Jordan Spiker

unread,
Jan 27, 2015, 7:43:24 PM1/27/15
to jenkins...@googlegroups.com
Hi all,

I have a Multijob that creates jobs based on a text file.

job(type: Multijob) {
    steps
{
        phase
('build') {
            f
.eachLine {
                job
(type: Matrix) {
                   
...
               
}
             
}
         
}
     
}
}

This does generate the sub-jobs fine, but they are not included in the Multijob phase.  How could I get the generated jobs to be included in the phase?

Thanks!

Jordan Spiker

unread,
Jan 28, 2015, 12:28:46 PM1/28/15
to jenkins...@googlegroups.com
I figured this out.
jobs = []

f
.eachLine { line ->
    jobs
+= job(type: Matrix) {
       
...

   
}
}

job
(type: Multijob) {
    steps
{
        phase
('build') {

            jobs
.each { j ->
                job
(j.name)
           
}
       
}
   
}
}
Reply all
Reply to author
Forward
0 new messages