[英]Jenkins : Passing a parameter from one job to another used Parameterized Trigger Plugin. Not Working
i have given as: in post build action's Parameterized Trigger Plugin 我给出了: 在post build action的参数化触发插件中
project to build : project B
Trigger when build is : complete
Trigger build without paramater : disabled
in predefined param sections:
Temp=${BUILD_NUMBER}
branch=$BRANCH
branch1="hai"
in project B 's Execute shell i have given as: 在项目B的执行shell我给出了:
echo "Testing..." $Temp
echo $branch
echo $branch1
FYI, i have given BRANCH=development 仅供参考,我给了BRANCH = development
console output of the Project B: 项目B的控制台输出:
+ echo Testing...
Testing...
+ echo
+ echo
======
seems variable is not promoted. 似乎变量不升级。
Select the "Trigger/call builds on other projects" in build section instead of post build section. 在构建部分中选择“在其他项目上触发/调用构建”,而不是在构建部分。
In the Build Triggers, 在构建触发器中,
Projects to build "project B" 建设“项目B”的项目
"Select" Block until the triggered projects finish their builds Fail this build step if the triggered build is worse or equal to "Failure" “选择”阻止,直到触发的项目完成构建如果触发的构建更糟或等于“失败”,则失败此构建步骤
Mark this build as failure if the triggered build is worse or equal to "Failure" 如果触发的构建更糟或等于“失败”,则将此构建标记为失败
Mark this build as unstable if the triggered build is worse or equal to "UNSTABLE" 如果触发的构建更糟或等于“不稳定”,则将此构建标记为不稳定
In the predefined parameters, 在预定义的参数中,
Temp=${BUILD_NUMBER} 温度= $ {} BUILD_NUMBER
branch=$BRANCH 支= $ BRANCH
branch1="hai" BRANCH1 = “海”
In your " project B " projects, 在你的“项目B”项目中,
"Click the build is parameterized option " “单击构建参数化选项”
And form the variable. 并形成变量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.