詹金斯管道下游作业变量

时间:2018-08-16 11:55:50

标签: jenkins jenkins-pipeline

是否有可能在管道变量中用于下游作业?

示例: [Retrieve build number or artifacts of downstream build in Jenkins

TRIGGERED_JOB_NAMES="Comma separated list of all triggered projects"
TRIGGERED_BUILD_NUMBERS_{project name}="Comma separated list of build numbers triggered"
TRIGGERED_BUILD_RESULT_{project name}="Last triggered build result of project"
TRIGGERED_BUILD_RESULT_{project name}RUN{build number}="Result of triggered build for build number"
TRIGGERED_BUILD_RUN_COUNT_{project name}="Number of builds triggered for the project"

我正在尝试:

stage "Build another job"
build job: "${params.myVAR}"


stage "Show TRIGGERED JOB VARIABLES"
echo "${env.TRIGGERED_JOB_NAMES_LIST}"
echo "------------++++++++++++++++++++--------------------"
echo "${env.LAST_TRIGGERED_JOB_NAME}"


stage "Copying artifacts"
copyArtifacts filter: '*.txt',
projectName: "${params.myVAR}", 
selector: "${I WANT TO GET BUILD NUMBER OF JOB DEFINER IN $myVAR}", target: 'output/'

谢谢。

0 个答案:

没有答案