jenkins上同步开始两个任务(parallel)

node('amd64') {
     
    stage('start') {
        echo "start"
        start(projects_a)
    }
    stage('AT-UT'){
        parallel (
            'pxe-and-at':{
                timeout(time: 300, unit: 'MINUTES'){
                    try{
                        build propagate: false, job : "iso-"
                    }catch(e){

                    }finally{

                    }
                }
            },
            'UT':{
                timeout(time: 300, unit: 'MINUTES') {
                    try{
                        runProjectTest(projects_a)
                    }
                    catch(e){

                    }
                    finally{

                    }
                    
                }
            
            }  

        )
    }

注意:parallel必须是键值对的形式: 

node('nnh561.raijin') {
    parallel (
        'gfortran': { build('trunk/build/gfortran') },          #这里必须有  逗号
        'ifort': { build('trunk/build/ifort') }
    )
}

 

posted @ 2021-12-20 10:33  Tarzen  阅读(758)  评论(0编辑  收藏  举报