Jenkins是否有办法根据父项目中的参数值动态触发另一个构建/项目?
这样做的原因是我有100个项目,我不想使用管道/条件构建后插件来链接所有作业。
我知道使用REST API的一种方法,但试图找到一种方法从这100个触发单个项目?
答案 0 :(得分:2)
轻松Pipeline Plugin。只需定义您的参数(比如Array(
"Italy" => array(
"Rome" => array(
"Mario Rossi" => array(
"Post 1" => array(.....),
"Post 2" => array(.....),
"Post 3" => array(.....),
"Post 4" => array(.....)
)
"No Person" => array(
"Post 1" => array(.....),
"Post 2" => array(.....),
"Post 4" => array(.....)
)
),
"No City" => array(
"Mario Rossi" => array(
"Post 1" => array(.....),
"Post 3" => array(.....),
"Post 4" => array(.....),
),
"No Person" => array(
"Post 1" => array(.....),
"Post 4" => array(.....)
)
)
)
"No Nation" => array(
"Rome" => array(
"Mario Rossi" => array(
"Post 2" => array(.....),
"Post 3" => array(.....),
"Post 4" => array(.....),
),
"No Person" => array(
"Post 2" => array(.....),
"Post 4" => array(.....),
)
),
"No City" => array(
"Mario Rossi" => array(
"Post 3" => array(.....),
"Post 4" => array(.....),
),
"No Person" => array(
"Post 5" => array(......)
)
)
)
);
)并在groovy脚本定义中使用它:
MY_DOWNSTREAM_JOB