![]() Here is an equivalent of the above CLI usage in Python: from pathlib import Path from git import Repo from junction.git import find_commits_on_branch_after, filter_modifications_to_folder, get_modifications from lta import Delta from nfluence import Confluence cf = Confluence ( "", , "YOUR_API_ACCESS_TOKEN", "SPACE_KEY" ) repo = Repo ( "." ). Using the Python library will let you create your own wrappers and tools, for example an AirFlow DAG. You can check what the junction CLI will do to your space without actually uploading the changes to Confluence by using the -dry-run flag. The CLI is fully documented, so make use of the -help option to navigate all of the configuration options. The variables are CONFLUENCE_API, CONFLUENCE_API_USER, and CONFLUENCE_API_KEY respectively. You can put the API, user, and key into environment variables to avoid specifying them for every invocation of Junction. The simplest way to use Junction is the included CLI junction: junction -s "SPACE_KEY" -c "" -u -p "YOUR_API_ACCESS_TOKEN" delta -content-path docs/ HEAD~5 master Junction is designed as a library, and also provides "helpers" that make using it in different contexts easy (in particularly, as part of automated workflows e.g. In your git repository, create a folder structure and markdown files you would like to publish. I recommend you make a dedicated user account with access permissions limited to the space(s) you want to manage with Junction. You will need to create an API token to use instead of a password. UsageĬollect a set of credentials that Junction will use to login to Confluence. See this example for what output looks like in Confluence. The page will gets its title from the file name, and its contents will be translated into Confluence markup. all markdown files will be kept in docs/. ![]() To allow mixing code (and other items) with markdown files for Junction in a single repository, you can tell Junction a subpath within your repository that functions as the root e.g. You must not manually change, create, or modify pages in the target space, or else Junction may be unable to synchronize the state in Git with the state in Confluence. Thus when using Junction you must tell it which Space to target and update. Junction (currently) expects to manage the entire space in Confluence. Junction works by inspecting the changes made on a commit-by-commit basis to your Git repository, and determining what needs to be changed in Confluence to reflect those changes. Install using pip: pip install confluence-junction ![]() This gives you the best of both worlds: in-repo documentation that fits natively into your development workflows, with the discoverability and centrality of Confluence.Įnsure you are using Python 3.8 (or newer) Junction does not work with older versions of Python. With Junction you can write and manage your documentation directly in your codebase, using Markdown and your existing Git workflows (pull requests, code review, release branches, etc) and then automatically publish your changes to Confluence.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |