简体   繁体   English

Jenkins:将参数从一个作业传递到另一个作业使用参数化触发器插件。 不工作

[英]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. 并形成变量。

On the 2nd job on the General section tick the box "This project is parameterized" and define the name of the parameter you are passing form the 1st job. 在“常规”部分的第二个作业上,勾选“此项目已参数化”框,并定义从第一个作业传递的参数的名称。 在此输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 jenkins参数化触发器插件来触发另一个构建 - jenkins Parameterized Trigger Plugin to trigger another build 使用Jenkins参数化远程触发插件“with File参数上传到远程降级Jenkins作业 - Use Jenkins Parameterized Remote Trigger Plugin" with File parameter to upload to the remote downsteream Jenkins job Jenkins参数化触发器插件将值传递为“ VALUE” - Jenkins Parameterized Trigger Plugin passing value as “VALUE” 将参数化的构建参数传递给Jenkins中的Jython插件 - Passing parameterized build parameter to Jython plugin in Jenkins 从 groovy 脚本触发参数化 Jenkins 作业 - Trigger parameterized Jenkins job from groovy script 将扩展选择参数值从一个作业传递到 Jenkins 管道中的另一个远程作业 - Passing extended choice parameter value from one job to another remote job in Jenkins pipeline 如何根据来自 Build Failure Analyzer Jenkins 插件的错误类别发送电子邮件/触发参数化远程作业? - How to send email/trigger parameterized remote job based on error category from Build Failure Analyzer Jenkins plugin? 将结果从Parameterized Trigger插件传回 - Passing the result back from Parameterized Trigger plugin Jenkins 2.x参数化触发器插件计算参数 - Jenkins 2.x Parameterized Trigger Plugin Computed Parameter 根据在第一份工作中选择的选项,如何使用动态参数插件在Jenkins中触发另一份工作 - based on options selected in first job, how to trigger another job in Jenkins using Dynamic parameter plugin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM