Sacred
Keep Github Wiki's, READMEs, or any other markdown files in sync with Confluence pages.
Sacred is configured with a manifest file that allows you to upload multiple confluence documents composed of many markdown files.
Currently a confluence document needs to exist (contentId) for Sacred to update it. Sacred will not (currently) create new documents.
Installation
go get -u github.com/coryodaniel/sacred
Usage
By default sacred looks for .sacred.yaml in the current directory.
sacred upload
# Specify an alternate config path
sacred upload -c path/to/my/config.yaml
Config Examples
Single Confluence document from a single markdown file
auth:
token: CONFLUENCE_API_TOKEN
domain: your-domain.atlassian.net
docs:
- name: My first document # This will update the Confluence document name
spaceId: CONFLUENCE_SPACE_ID
contentId: CONFLUENCE_CONTENT_ID
files:
- ./README.md
Multiple Confluence Documents with multiple markdown files
auth:
token: CONFLUENCE_API_TOKEN
domain: your-domain.atlassian.net
docs:
- name: My first document
# notice: will set a notice at the top of the generated HTML
notice: <strong>DO NOT EDIT! This file is autogenerated from https://my-repo</strong>
spaceId: CONFLUENCE_SPACE_ID
contentId: CONFLUENCE_CONTENT_ID_1
files:
- ./README.md
- ./CONTRIBUTORS.md
- name: Another document
spaceId: CONFLUENCE_SPACE_ID
contentId: CONFLUENCE_CONTENT_ID_2
files:
- ./README.md
- ./wiki/intro-to-widgets.md
- ./wiki/advanced-widgetry.md
# globs will be appened in alphabetical order and will not include files listed above
- ./wiki/*.md
Additionally the following environment variables may be set:
SACRED_TOKEN - Override auth.token
SACRED_DOMAIN - Override auth.domain
Creating a Confluence API Token
Create an API token from your Atlassian account:
- Log in to https://id.atlassian.com.
- Click API tokens
- Then Create API token
This token can either be set in your .sacred.yaml file or in the SACRED_TOKEN environment variable.
Confluence Content and Space Identifiers
The content and space ID can be found in the content URL:
https://YOUR_DOMAIN.atlassian.net/wiki/spaces/SPACE_ID/pages/CONTENT_ID/Markdown+Test