Skip to content

A Gradle plugin that enables the creation of tasks for publishing pages to Confluence

Notifications You must be signed in to change notification settings

crob1140/confluence-page-publisher

Repository files navigation

confluence-page-publisher

Build Status Test Coverage

This plugin allows Confluence pages to be published through a Gradle task.

Installation

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'

Usage

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']
}

Contribution

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.

License

MIT

About

A Gradle plugin that enables the creation of tasks for publishing pages to Confluence

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages