This plugin allows Confluence pages to be published through a Gradle task.
Add the following to your build.gradle to include the plugin:
plugins {
id 'com.github.crob1140.confluence-page-publisher'
}
or alternatively:
apply plugin: 'com.github.crob1140.confluence-page-publisher'
The connection details for your Confluence server can be set through the 'confluence' extension that is added by this plugin:
confluence {
url = 'http://www.sample.com/wiki'
username = 'sampleuser'
password = 'samplepass'
}
You can then define one or more tasks of type PublishConfluencePage that will use these settings:
task publishReleaseNotes(type: PublishConfluencePage) {
spaceKey = 'SAMPLE'
parentTitle = 'Sample Releases'
title = "Sample v${project.version} Release Notes"
body = '<ac:rich-text-body>SAMPLE</ac:rich-text-body>'
labels = ['release-notes']
}
Whilst all tasks of type PublishConfluencePage will inherit their connection details from the 'confluence' extension by default, you can also set the connection details per task if you need to:
task publishReleaseNotes(type: PublishConfluencePage) {
serverUrl = 'http://www.sample.com/wiki'
username = 'sampleuser'
password = 'samplepass'
spaceKey = 'SAMPLE'
parentTitle = 'Sample Releases'
title = "Sample v${project.version} Release Notes"
body = '<ac:rich-text-body>SAMPLE</ac:rich-text-body>'
labels = ['release-notes']
}
If you have any requests, feel free to raise them as issues. You are also free to fork the repository to make your own changes, and then raise a pull request so that your changes can be merged in.
MIT