html tool

2020年9月28日星期一

jenkins pipeline 并行eg

参考:https://www.jenkins.io/doc/pipeline/examples/#jobs-in-parallel 


def branches=[:]     #定义并行的结构,相当于运行的容器吧,这后面的parallel branches想呼应

#下面定义每一个的branche 

    branches["branch1"] = { 

        node("192.168.100.121"){  //使用node指定这个job的运行位置

            stage("run1"){               //stage是最后在运行结果页显示步骤列的位置用,这个测试要在执行脚本的上一级,但不能再node上

            build job: 'param1', parameters:[   //要运行的其他job 及其参数

                string(name:"hi",value:"1")

            ]}

        }

        

    }


    branches["branch2"] = {

        node("192.168.100.121I"){

            stage("run2"){

            build job: 'param2', parameters:[

                string(name:"hi",value:"2")

            ]}

            }

        

    }

parallel branches

没有评论:

发表评论