This procedure describes how to use the auto_rn_ft.py
Python script as part of a GitLab CI/CD pipeline.
Developer
, Maintainer
, and Owner
users of a GitLab repository can launch it to generate release notes, and publish them to Fluid Topics automatically.
By using a GitLab CI/CD pipeline, these users share a common configuration. They do not have to install Python, the necessary modules, or set up the environment variables.
- In a GitLab repository, go to Settings, and open the CI/CD menu.
- Select Variables, and select Add variable.
-
Add four variable keys, and assign them values:
JIRA_URL
JIRA_USER
JIRA_PASSWORD
FT_API_KEY
For more information on how to create a Fluid Topics API key, see API keys.
API keys with one of the following roles can upload a release notes archive through
ftpub
:ADMIN
KHUB_ADMIN
CONTENT_PUBLISHER
(if the user has permission to publish content through aftml
source).
-
Create a
ci
folder at the root of the repository. - Upload the
auto_rn_ft.py
Python script in theci
folder. -
Upload a version of
ftpub
ending withlinux-amd64
in theci
folder.To download ftpub, see Fluid Topics Publisher (ftpub).
-
Create a
.gitlab-ci.yml
at the root of the repository. -
Copy and paste the following job inside.
image: python auto_jira_rn: before_script: - pip3 install jira - pip3 install jinja2 - pip3 install pypandoc_binary script: - python ci/auto_rn_ft.py - echo "Publishing release notes..." - chmod +x ci/ftpub-0.1.5-linux-amd64 - ci/ftpub-0.1.5-linux-amd64 publish rn.zip -s ftml --api-key ${FT_API_KEY} https://$REPLACE_WITH_A_FLUID_TOPICS_PORTAL_ADDRESS.com artifacts: paths: - rn.zip only: - web
-
Replace
https://$REPLACE_WITH_A_FLUID_TOPICS_PORTAL_ADDRESS.com
with the portal on which to publish the release notes. - Save.
- Go to the CI/CD menu, and open the Pipelines menu.
- Select Run pipeline.
- Select Run pipeline again.
-
Open the Administration menu of the Fluid Topics portal, and select Knowledge Hub.
The release notes are uploading.