Skip to content

Instantly share code, notes, and snippets.

@dkhode
Forked from glombard/my-job-generator.groovy
Created October 10, 2016 18:00
Show Gist options
  • Save dkhode/29b78699f0f7f77391c72d28c69afc43 to your computer and use it in GitHub Desktop.
Save dkhode/29b78699f0f7f77391c72d28c69afc43 to your computer and use it in GitHub Desktop.
Using Jenkins Job-DSL plugin to create a job with a Post-Build Step / publisher plugin
job('my-generated-job') {
description('This job was automatically generated by a Job-DSL seed job')
steps {
shell('echo Testing Job-DSL and log-parser')
}
wrappers {
colorizeOutput('xterm')
}
// Use configure to add the 'publishers' XML node in the generated config.xml
configure { project ->
project / publishers << 'hudson.plugins.logparser.LogParserPublisher'(plugin: 'log-parser@1.0.8') {
unstableOnWarning(false)
failBuildOnError(true)
parsingRulesPath('/Users/Shared/Jenkins/Home/log-parser/test.txt')
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment