I'm trying to configure the Graphite integration plugin for my jobs using Jenkins Job DSL. My block looks like this:
coreJobs = [my jobs here]
coreJobs.each{ a ->
// some extra job config here
job("$a") {
project / 'publishers' / 'org.jenkinsci.plugins.graphiteIntegrator.GraphitePublisher' {
selectedIp '192.123.1.456'
metrics {
'org.jenkinsci.plugins.graphiteIntegrator.Metric' {
queueName ".${a}.BuildFailed"
name 'BUILD_FAILED'
}
}
}
}
}
Without this graphite declaration it loops through, creating jobs using the jobs declared in $a. But because the graphite dsl requires a "name" parameter the DSL generator just ignores the jobs declared in $a and creates a job called "BUILD_FAILED" !!
So my question is how can I stop the DSL plugin trying to use the "name" parameter as a job name?
Some additional info, I don't think BUILD_FAILED should be a string. I think it's an object but I'm not sure how I would use that here or if it requires different syntax.
Thanks