https://github.com/coryodaniel/sacred
A CLI to sync markdown to the Confluence REST API
https://github.com/coryodaniel/sacred
Last synced: about 2 months ago
JSON representation
A CLI to sync markdown to the Confluence REST API
- Host: GitHub
- URL: https://github.com/coryodaniel/sacred
- Owner: coryodaniel
- License: mit
- Created: 2018-10-16T20:17:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-23T22:19:30.000Z (over 7 years ago)
- Last Synced: 2025-12-29T23:30:30.602Z (6 months ago)
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```yaml
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
```yaml
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: DO NOT EDIT! This file is autogenerated from https://my-repo
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:
1. Log in to https://id.atlassian.com.
2. Click API tokens
3. 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`