Skip to content

Instantly share code, notes, and snippets.

@martiell
Created June 22, 2012 21:02
Show Gist options
  • Save martiell/2975183 to your computer and use it in GitHub Desktop.
Save martiell/2975183 to your computer and use it in GitHub Desktop.
Gerrit and jenkins-maven-plugin
<job>
<id>review</id>
<parent>base</parent>
<abstract>true</abstract>
<process>{{
node.scm.buildChooser[0].attributes().class =
'com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser'
def name = node.scm.userRemoteConfigs[0].children()[0].url.text()
name = name.substring(name.lastIndexOf('/') + 1, name.lastIndexOf('.'))
def c = new NodeBuilder().
'com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger'() {[
spec { },
gerritProjects {
'com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject' {[
compareType('PLAIN'),
pattern(name),
branches {
'com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch' {[
compareType('ANT'),
pattern('**')
]}
}
]}
},
silentMode('false'),
escapeQuotes('true'),
buildStartMessage {},
buildFailureMessage {},
buildSuccessfulMessage {},
buildUnstableMessage {},
buildUnsuccessfulFilepath {},
customUrl {}
]}
node.triggers[0].append(c)
}}</process>
</job>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment