Pipeline jobs - pass parameters upstream?

后端 未结 1 637
闹比i
闹比i 2021-01-05 14:45

TL;DR: Obviously in a Jenkins pipeline job you can easily pass parameters downstream. What I want to know is if you can pass them upstream.

Use ca

1条回答
  •  一生所求
    2021-01-05 15:26

    It should be as simple as that:

    stage ('Build 3') {
            res = build job: 'job_three', parameters: [[$class: 'StringParameterValue', name: 'filename', value: "$filename"]]
            echo "$res.buildVariables.filename"
    }
    

    Assuming that in job_three you do

    env.filename = "col new file name"
    

    0 讨论(0)
提交回复
热议问题