2017-03-10 22 views
3

パイプラインジョブから行列ビルドを開始したいが、1つのAxisだけを構築したい。Jenkins:パイプラインからのMatrixCombinationsParameterValue

私はこれを試みた:

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']]] 

をI 2つの軸、flavorbuildTypeを有し、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']) 
     ] 

が、それはRejectedAccessException: Scripts not permitted to use newので失敗します。

私はほとんど正しい方法で組み合わせを提供していないと確信していますが、他に何ができるかはわかりません。

更新私はこのようなパラメータを設定しようとしたクリストファー・オア答えた後

  • 味:ドイツイタリアメキシコUnitedStatesの
  • 私の軸として、これと

    [$class: 'MatrixCombinationsParameterValue', name: 'paramFilter', description: null, combinations: ['buildType=Release,flavor=Italy']]] 
    

  • buildType:デバッグリリース

私はスレーブ軸を持っていることを忘れていて、それも指定する必要があります。

だから、これは私のために働いていたものです:

[$class: 'MatrixCombinationsParameterValue', combinations: ["buildType=Release,flavor=Italy,label=android"], description: '', name: 'paramFilter'] 

答えて

1

あなたがウェブUIからマトリックスの組み合わせプラグインを使用すると、あなたは明示的に実行したいすべての組み合わせを指定する必要があります。だからパイプラインで同じことをする必要があります。例えば、

combinations: ['buildType=Release,flavor=beta', 
       'buildType=Release,flavor=production'] 
関連する問題