Skip to content

Deployment Patterns

CCFM supports several deployment patterns depending on your team structure and documentation needs.


Pattern 1: Single Environment

The simplest setup — one repository, one Confluence space.

repo/
└── docs/
    ├── getting-started.md
    ├── api-reference.md
    └── guides/
        ├── .page_content.md
        └── deployment.md
# ccfm.yaml
version: 1
domain: company.atlassian.net
email: ${CONFLUENCE_EMAIL}
token: ${CONFLUENCE_TOKEN}
space: DOCS
docs_root: docs
ccfm plan --directory docs
ccfm apply --directory docs --auto-approve

Best for: Small teams, single product documentation, internal tooling docs.


Pattern 2: Multi-Environment

Deploy the same docs to different Confluence spaces (e.g., staging and production) using separate config files or environment variables.

# Deploy to staging
CONFLUENCE_DOMAIN=staging.atlassian.net \
CONFLUENCE_TOKEN=$STAGING_TOKEN \
ccfm apply --directory docs --space DOCS-STAGING --auto-approve

# Deploy to production
CONFLUENCE_DOMAIN=company.atlassian.net \
CONFLUENCE_TOKEN=$PROD_TOKEN \
ccfm apply --directory docs --space DOCS --auto-approve

Or use separate config files:

ccfm --config ccfm-staging.yaml apply --directory docs --auto-approve
ccfm --config ccfm-prod.yaml apply --directory docs --auto-approve

Best for: Teams that want to review docs in a staging space before publishing to production.


Pattern 3: Multi-Source

Two (or more) documentation trees in one repository, each synced to a different Confluence space using its own CCFM config file.

repo/
├── ccfm-api.yaml         # Config targeting ENG space
├── ccfm-wiki.yaml        # Config targeting WIKI space
├── docs/                 # API documentation
│   ├── getting-started.md
│   └── endpoints.md
└── docs-wiki/            # Team wiki pages
    ├── runbooks.md
    └── onboarding.md

Each config points at a different docs_root and space:

# ccfm-api.yaml
version: 1
domain: company.atlassian.net
email: ${CONFLUENCE_EMAIL}
token: ${CONFLUENCE_TOKEN}
space: ENG
docs_root: docs
# ccfm-wiki.yaml
version: 1
domain: company.atlassian.net
email: ${CONFLUENCE_EMAIL}
token: ${CONFLUENCE_TOKEN}
space: WIKI
docs_root: docs-wiki

Deploy each source independently:

ccfm --config ccfm-api.yaml plan --directory docs
ccfm --config ccfm-api.yaml apply --directory docs --auto-approve

ccfm --config ccfm-wiki.yaml plan --directory docs-wiki
ccfm --config ccfm-wiki.yaml apply --directory docs-wiki --auto-approve

Best for: Repos that own documentation across multiple Confluence spaces — e.g., API docs in an engineering space and team runbooks in an internal wiki space.

See the full working example in the ccfm-examples/standalone/multi-source directory.


Examples Repository

For complete working examples of these patterns with CI/CD configurations, see the ccfm-examples repository.