-
Improvement
-
Resolution: Not A Defect
-
Major
-
None
-
Plugin version: 1.1.0
Jenkins version: 1.653
I would like to build only some combinations of a matrix job from a pipeline job using the groovy API build.
There is a class called MatrixCombinationsParameterValue in this API but the axis are not taken into account.
For instance if I use this code
def MatrixConfig = "(MyAxis == 'MyAxisValue')" build job: "$jobname", propagate: false, wait: true, parameters: [[$class: 'MatrixCombinationsParameterValue', name: 'MatrixConfig', value: "$MatrixConfig"]]
The job which name is contained inside the variable jobname is correctly built but without any combination (so basically nothing is done except starting and exiting the job)...
(MatrixConfig is the name of the MatrixCombinationsParameter in the job $jobname)
Moreover, when I look into the environment variables of this build of the matrix job the value of MatrixConfig is empty.
Is the trigger from a pipeline job not supported or am I doing something wrong?
This is quite blocking as we cannot use other jobs than pipeline jobs.
EDIT: I found a "workaround" with this code:
build job: "$jobname", propagate: false, wait: true, parameters: [ new hudson.plugins.matrix_configuration_parameter.MatrixCombinationsParameterValue ("MatrixConfig", "description", ['MyAxis=MyAxisValue']) ]
Isn't the first solution supposed to work also?