0

How do I publish the generated valgrind results in jenkins using dsl script. I'm able to do publishers.archiveArtifacts / publishers.archiveJunit but I'm not able to do the same for valgrind.

Following thing I tried but got following exception

job.publishers {
 configure { node ->
   node << 'org.jenkinsci.plugins.valgrind.ValgrindPublisher' {
   }
 }
}

javaposse.jobdsl.dsl.helpers.publisher.PublisherContext.configure() is applicable for argument types:
 (builders.JobBuilder$_create_job_closure6_closure19) values
 [builders.JobBuilder$_create_job_closure6_closure19@af5d326]
Shiva
  • 81
  • 2
  • 10

1 Answers1

0

The Configure Block is only available in the job context, but not in the publishers context:

job('example-1') {
  configure { node ->
    node / publishers << 'org.jenkinsci.plugins.valgrind.ValgrindPublisher' {
      // options
    }
  }
}

As an alternative, you can use the Automatically Generated DSL:

job(String name) {
  publishers {
    valgrindPublisher {
      pattern(String value)
      failThresholdInvalidReadWrite(String value)
      failThresholdDefinitelyLost(String value)
      failThresholdTotal(String value)
      unstableThresholdInvalidReadWrite(String value)
      unstableThresholdDefinitelyLost(String value)
      unstableThresholdTotal(String value)
      publishResultsForAbortedBuilds(boolean value)
      publishResultsForFailedBuilds(boolean value)
      failBuildOnMissingReports(boolean value)
      failBuildOnInvalidReports(boolean value)
    }
  }
}
daspilker
  • 8,154
  • 1
  • 35
  • 49
  • I tried doing this publishers {configure { node -> node << 'org.jenkinsci.plugins.valgrind.ValgrindPublisher' {}}}} but the dsl threw an error – Shiva Feb 20 '17 at 17:55