Skip to content

Instantly share code, notes, and snippets.

@johnbuhay
Last active February 1, 2017 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnbuhay/fbc710cc77bd5e5e7f196fe0ab16fd92 to your computer and use it in GitHub Desktop.
Save johnbuhay/fbc710cc77bd5e5e7f196fe0ab16fd92 to your computer and use it in GitHub Desktop.
Jenkins configuration snippets | Job DSL
#!/usr/bin/env groovy
# this is technically Jenkins Job Dsl
version = 1
job('example') {
publishers {
configure { node ->
node / 'publishers' << 'hudson.plugins.doclinks.DocLinksPublisher' {}
node / 'publishers' / 'hudson.plugins.doclinks.DocLinksPublisher' << 'documents' {}
node / 'publishers' / 'hudson.plugins.doclinks.DocLinksPublisher' / 'documents' << 'hudson.plugins.doclinks.Document' {
title('Code Coverage')
description('Coverage report generated by rspec')
directory('coverage')
recursive(true)
file('index.html')
id(1)
}
}
}
}
<project>
...
<publishers>
<hudson.plugins.doclinks.DocLinksPublisher plugin="doclinks@0.6.1">
<documents>
<hudson.plugins.doclinks.Document>
<title>Code Coverage</title>
<description>Coverage report generated by rspec</description>
<directory>coverage</directory>
<recursive>true</recursive>
<file>index.html</file>
<id>1</id>
</hudson.plugins.doclinks.Document>
</documents>
</hudson.plugins.doclinks.DocLinksPublisher>
</publishers>
<buildWrappers/>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment