Jenkins pipeline pass all parameters down to downstream jobs

后端 未结 3 1140
情深已故
情深已故 2021-02-19 11:56

I have a pipeline job named buildall which looks like this:

pipeline {
    stages {
        stage(\"job1\") {
            build job: \"job1\"
           


        
3条回答
  •  春和景丽
    2021-02-19 12:14

    You can pass all your pipeline parameters with this :

    def params=[]
    env.getEnvironment().each{ k, v ->
            params.add(string(name:"${k}", value:"${v}"))
       }
    
    def slaveJob = build job: 'BuildJob', parameters:params
    

提交回复
热议问题