简体   繁体   English

多配置詹金斯工作

[英]Multi configuration Jenkins job

I have a multi configuration matrix job that consists of 3 configurations. 我有一个包含3个配置的multi configuration matrix job I have one user defined axis lets call it ParameterA and it has 3 values value1, value2, value3 for each configuration. 我有一个用户定义的轴,可以将其称为ParameterA,并且每种配置都有3个值value1,value2,value3。

The job also has a promote process. 该工作还具有晋升过程。 In the promote process I copy the 3 artifacts produced and I'd like to use groovy/curl to push them to Artifactory. 在升级过程中,我复制了所产生的3个工件,我想使用groovy / curl将它们推到Artifactory。

In order to do this I need to loop through the names of the artifacts (the names are made up of the jobName-. 为此,我需要遍历工件的名称(名称由jobName-组成。

Is there a way to retrieve or save all the values of ParameterA so that I can loop through them and perform a curl command to upload each one? 有没有办法检索或保存ParameterA的所有值,以便我可以遍历它们并执行curl命令以上传每个值?

Something like ParameterA=value1,value2,value3 ParameterA=value1,value2,value3

One way you could do this is by using the Groovy Postbuild Plugin in the promote process job (I'm assuming it's a separate job?). 一种方法是在升级流程作业中使用Groovy Postbuild插件 (我假设它是单独的作业?)。

In the postbuild step, you will have access to the Jenkins model which contains everything you would probably need to extract the ParameterA axis, as well as the ability to upload via groovy/curl. 在构建后的步骤中,您将可以访问Jenkins模型 ,该模型包含提取ParameterA轴可能需要的所有内容,以及通过groovy / curl上传的功能。

Unfortunately, I can't get to the Jenkins javadoc right now, so I couldn't look up the necessary functions to retrieve the corresponding ParameterA axis, but hopefully this will get you started. 不幸的是,我现在无法进入Jenkins javadoc,因此无法查找必要的函数来检索相应的ParameterA轴,但是希望这可以帮助您入门。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM