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

postBuildScript matrix DSL configuration problem

      PostBuildScript plugin DSL not working for matrix jobs.

       

      I've tried this:

          matrixPostBuildScript {
              buildSteps {
                  postBuildStep {
                      buildSteps {
                          shell {
                              command('/path/to/script')
                          }
                      }
                  }
              }
          }
       

      which results in:

       15:27:26 ERROR: (test.dsl, line 110) No signature of method: javaposse.jobdsl.dsl.jobs.MatrixJob.matrixPostBuildScript() is applicable for argument types: (BCM1000_Z9_test_matrix_matrix_multisite$_run_closure1$_closure10) values: [BCM1000_Z9_test_matrix_matrix_multisite$_run_closure1$_closure10@4e487f7a]

      and

          matrixPostBuildScript {
              buildSteps {
                  postBuildStep {
                      buildSteps {
                          shell {
                              command('/path/to/script')
                          }
                      }
                  }
              }
          }
       

      which also results in:

      15:38:52 ERROR: (BCM1000_Z9_test_matrix_matrix_multisite.dsl, line 110) No signature of method: javaposse.jobdsl.dsl.jobs.MatrixJob.matrixPostBuildScript() is applicable for argument types: (BCM1000_Z9_test_matrix_matrix_multisite$_run_closure1$_closure10) values: [BCM1000_Z9_test_matrix_matrix_multisite$_run_closure1$_closure10@42e11c53] 

      The config.xml section looks like

      
      

      <org.jenkinsci.plugins.postbuildscript.MatrixPostBuildScript plugin="postbuildscript@3.2.0-460.va_fda_0fa_26720">
      <config>
      <scriptFiles>
      <org.jenkinsci.plugins.postbuildscript.model.ScriptFile>
      <results>
      <string>SUCCESS</string>
      <string>NOT_BUILT</string>
      <string>ABORTED</string>
      <string>FAILURE</string>
      <string>UNSTABLE</string>
      </results>
      <role>BOTH</role>
      <executeOn>MATRIX</executeOn>
      <filePath>path/to/script</filePath>
      <scriptType>GENERIC</scriptType>
      <sandboxed>false</sandboxed>
      </org.jenkinsci.plugins.postbuildscript.model.ScriptFile>
      </scriptFiles>
      <groovyScripts/>
      <buildSteps/>
      <markBuildUnstable>false</markBuildUnstable>
      </config>
      </org.jenkinsci.plugins.postbuildscript.MatrixPostBuildScript>
      </publishers>
      <buildWrappers>
      <noformat}

          [JENKINS-71923] postBuildScript matrix DSL configuration problem

          What about?

          matrixJob('My Matrix Job') {
              axes {
                  axis {
                      name('OPTION')
                      values('VALUE1', 'VALUE2')
                  }
                  // Add more axes if needed
              }
              configurations {
                  matrixProject('My Matrix Job/${OPTION}') {
                      description('My Matrix Job')
                      logRotator {
                          numToKeep(10)
                          daysToKeep(2)
                      }
                      axes {
                          axis {
                              name('OPTION')
                              values('VALUE1', 'VALUE2')
                          }
                          // Add more axes if needed
                      }
                      publishers {
                          // Configure other publishers if needed
                      }
                      buildWrappers {
                          // Configure build wrappers if needed
                      }
                      builders {
                          // Configure builders if needed
                      }
                      triggers {
                          // Configure triggers if needed
                      }
                      matrixPostBuildScript {
                          scriptFiles {
                              scriptFile {
                                  scriptType('GENERIC')
                                  filePath('path/to/script')
                                  role('BOTH')
                                  executeOn('MATRIX')
                                  results {
                                      result('SUCCESS')
                                      result('NOT_BUILT')
                                      result('ABORTED')
                                      result('FAILURE')
                                      result('UNSTABLE')
                                  }
                                  sandboxed(false)
                              }
                          }
                          groovyScripts {
                              // Add Groovy scripts if needed
                          }
                          buildSteps {
                              // Add build steps if needed
                              shell {
                                  command('/path/to/script')
                              }
                          }
                          markBuildUnstable(false)
                      }
                  }
              }
          }

           

          Bruno Verachten added a comment - What about? matrixJob( 'My Matrix Job' ) {     axes {         axis {             name( 'OPTION' )             values( 'VALUE1' , 'VALUE2' )         }         // Add more axes if needed     }     configurations {         matrixProject( 'My Matrix Job/${OPTION}' ) {             description( 'My Matrix Job' )             logRotator {                 numToKeep(10)                 daysToKeep(2)             }             axes {                 axis {                     name( 'OPTION' )                     values( 'VALUE1' , 'VALUE2' )                 }                 // Add more axes if needed             }             publishers {                 // Configure other publishers if needed             }             buildWrappers {                 // Configure build wrappers if needed             }             builders {                 // Configure builders if needed             }             triggers {                 // Configure triggers if needed             }             matrixPostBuildScript {                 scriptFiles {                     scriptFile {                         scriptType( 'GENERIC' )                         filePath( 'path/to/script' )                         role( 'BOTH' )                         executeOn( 'MATRIX' )                         results {                             result( 'SUCCESS' )                             result( 'NOT_BUILT' )                             result( 'ABORTED' )                             result( 'FAILURE' )                             result( 'UNSTABLE' )                         }                         sandboxed( false )                     }                 }                 groovyScripts {                     // Add Groovy scripts if needed                 }                 buildSteps {                     // Add build steps if needed                     shell {                         command( '/path/to/script' )                     }                 }                 markBuildUnstable( false )             }         }     } }  

            dheid Daniel Heid
            jimsearle Jim Searle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: