Jenkins:来自管道的MatrixCombinationsParameterValue
我想从管道作业开始矩阵构建,但我只想构建一个轴 我试过这个:Jenkins:来自管道的MatrixCombinationsParameterValue,jenkins,jenkins-plugins,jenkins-pipeline,Jenkins,Jenkins Plugins,Jenkins Pipeline,我想从管道作业开始矩阵构建,但我只想构建一个轴 我试过这个: build job: "Build_Android_Matrix", propagate: false, wait: true, parameters: [[$class: 'StringParameterValue', name: 'branch', value: "$branch"], [$class: 'BooleanParameterValue', name: 'production'
build job: "Build_Android_Matrix", propagate: false, wait: true,
parameters: [[$class: 'StringParameterValue', name: 'branch', value: "$branch"],
[$class: 'BooleanParameterValue', name: 'production', value: true],
[$class: 'BooleanParameterValue', name: 'beta', value: false],
[$class: 'MatrixCombinationsParameterValue', name: 'paramFilter', description: null, combinations: ['buildType=Release']]]
我有两个轴,flavor
和buildType
,而paramFilter
是矩阵组合参数
矩阵生成从所有作业参数开始,但它不生成任何内容,因为矩阵组合选择为空
我也尝试过['buildType==Release']
和['buildType==“Release”]
但是我总是得到同样的结果
我也尝试过:
build job: "Build_Android_Matrix", propagate: false, wait: true, parameters: [
new hudson.plugins.matrix_configuration_parameter.MatrixCombinationsParameterValue
("paramFilter",
null,
['buildType=Release'])
]
但是它失败了,因为拒绝访问异常:脚本不允许使用新的
我几乎可以肯定,我没有以正确的方式提供组合,但我不知道我还能尝试什么
更新
在Christopher Orr回答后,我尝试设置如下参数:
[$class: 'MatrixCombinationsParameterValue', name: 'paramFilter', description: null, combinations: ['buildType=Release,flavor=Italy']]]
以此为轴:
- 风味:德国意大利墨西哥美国
- buildType:调试版本
因为我忘了我也有一个奴隶轴,这也必须指定
这就是我的工作原理:
[$class: 'MatrixCombinationsParameterValue', combinations: ["buildType=Release,flavor=Italy,label=android"], description: '', name: 'paramFilter']
从web UI使用矩阵组合插件时,需要明确指定要运行的所有组合。因此,在管道中,您需要执行相同的操作,例如:
combinations: ['buildType=Release,flavor=beta',
'buildType=Release,flavor=production']
参数的顺序很重要