How to make Pipeline job to wait for all triggered parallel jobs?

前端 未结 4 1195
太阳男子
太阳男子 2020-12-28 16:48

I\'ve Groovy script as part of the Pipeline job in Jenkins as below:

node {
    stage(\'Testing\') {
        build job: \'Test\', parameters: [string(name: \         


        
4条回答
  •  滥情空心
    2020-12-28 17:23

    Just run into the same problem, and find a working solution. Just use foreach.

    stage('testing') {
        def jobs = [:]
    
        [1,2,3,4,5].each{
            i -> jobs["Test${i}"] = {
                build job: 'Test', 
                parameters: [string(name: 'theparam', value: "${i}")],
                quietPeriod: 2
            }
        }
        parallel jobs
    }
    

提交回复
热议问题