Hi,
I am trying to convert a maven job that has postbuilders, reporters and runPostStepsIfResult
Source job config.xml</maven2-moduleset>
...
<reporters>
<hudson.maven.reporters.MavenMailer>
<recipients>
te...@test.com</recipients>
<dontNotifyEveryUnstableBuild>true</dontNotifyEveryUnstableBuild>
<sendToIndividuals>true</sendToIndividuals>
<perModuleEmail>false</perModuleEmail>
</hudson.maven.reporters.MavenMailer>
</reporters>
<prebuilders/>
<postbuilders>
<hudson.plugins.descriptionsetter.DescriptionSetterBuilder plugin="descripti...@1.10">
<regexp></regexp>
<description>Branch: ${BRANCH}</description>
</hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
</postbuilders>
<runPostStepsIfResult>
<name>FAILURE</name>
<ordinal>2</ordinal>
<color>RED</color>
<completeBuild>true</completeBuild>
</runPostStepsIfResult>
</maven2-moduleset>
I can use the
configure block to generate this:
configure { maven2moduleset ->
maven2moduleset << delegate.'reporters' {
'hudson.maven.reporters.MavenMailer' {
'recipients'('
te...@test.com')
'dontNotifyEveryUnstableBuild'(true)
'sendToIndividuals'(true)
'perModuleEmail'(false)
}
}
maven2moduleset << delegate.'prebuilders'()
maven2moduleset << delegate.'postbuilders' {
'hudson.plugins.descriptionsetter.DescriptionSetterBuilder'(plugin:'descripti...@1.10') {
'regexp'()
delegate.'description'('Branch: ${BRANCH}')
}
}
maven2moduleset << delegate.'runPostStepsIfResult' {
'name'('FAILURE')
'ordinal'(2)
'color'('RED')
'completeBuild'(true)
}
}
I do not have any prebuilders so I think i can just ignore this.
For the postBuilders, what should I use in dsl?
Should i use this syntax?
mavenJob('example-2') {
postBuildSteps('SUCCESS') {
shell("echo 'run after Maven'")
}
}
Also how should i convert the reporters?
Should i use this dsl?
publishers {
mailer('
m...@example.com', true, true)
}
Kirk