Skip to content

devwithkrishna/publish-confluence-pages-programatically

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

publish-confluence-pages-programatically

publish confluce pages programattically

using poetry as python virtual environment manager

Python sdk from atlassian

Python-dotenv package takes care of env variable set up on local system

.env file

CONFLUENCE_URL="xxxx"
CONFLUENCE_USERNAME="xxxx"
CONFLUENCE_PASSWORD="xxxx"

✔️ Replace "xxxx" with proper values. this is used for authentication

Program Inputs

The program requires 4 Inputs

  • action --> action to be performed. One among 'create','update','append','delete'
  • confluence_space --> confluence space
  • confluence_page_title --> new confluence page title
  • markdown_file_path --> markdown file path and name based. of md files are inside a folder use complete path

    Eg: foldername/markdown file name

Run code in local

  1. clone the repository to your local
  2. Change directory to the cloned repository
  3. set up the .env file
  4. Run python3 confluence.py --confluence_space <provide your confluence space name> --confluence_page_title "<Confluence title>" --action <action> --markdown_file_path <markfown file>
  5. Run python3 confluence.py --confluence_space devwithkrishna --confluence_page_title "This is the title - QT" --action update --markdown_file_path README.md

usage: confluence.py [-h] --action {create,update,append,delete} --confluence_space CONFLUENCE_SPACE --confluence_page_title CONFLUENCE_PAGE_TITLE --markdown_file_path MARKDOWN_FILE_PATH

Note

This Program uses username & api key for authentication with atlassian confluence. On local testing python-dotenv with .env file is used On GitHub Workflow, passed as aa environment variable in from GitHub Secrets.