Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61504

Declaring a Matrix Combination Parameter in declarative pipeline

XMLWordPrintable

      It would be great to be able to declare a Matrix Combination Parameter in declarative pipeline. Code like this (found at https://jenkinsci.github.io/job-dsl-plugin/#method/javaposse.jobdsl.dsl.helpers.BuildParametersContext.matrixCombinationsParam) does not work:

       

      pipeline {
         parameters {
           matrixCombinationsParam 'TARGET_ARCHS', description: 'Target platforms to build engine for'
         }
      }

       Or maybe it is currently somehow achievable via '$class' and 'MatrixCombinationsParameterDefinition' (if yes, then this should be documented)? 

      properties([
        [$class: 'ParametersDefinitionProperty',
         parameterDefinitions: [
           [$class: 'MatrixCombinationsParameterDefinition',
             name: 'TARGET_ARCHS',
             description: 'Target platforms to build engine for'
           ]
         ]
       ]
      ])
      
      pipeline {
         ...
      }

      The code above leads to:

       TARGET_ARCHSNot applicable. Applicable only to multi-configuration projects.

      Also don't know how to use the approach with 'properties' above to extend the set of parameters with a new MatrixCombinationsParameterDefinition one instead of overwriting the entire parameter list.

            Unassigned Unassigned
            wszebor Wszebor W.
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: