获取在Jenkinsfile内部构建的下游作业内部创建的变量

时间:2019-01-16 04:10:18

标签: environment-variables jenkins-pipeline

在下游(getversion)作业中,我在shell脚本中创建了一个变量。我如何才能将其值分配给上游工作(该工作是管道工作)以回显消息?

def result  = build job: 'getversion', parameters: [
                [$class: 'StringParameterValue', name: 'repo', value: repo]
            ]// inside UI job getversion there is a script create variable version
            echo result.buildVariables.version //=> it is error

echo version //it prints value of version variable

0 个答案:

没有答案