It is first necessary to set up the GitLab CI job.
To do so:
- In a GitLab repository, go to Settings, and open the CI/CD menu.
- Select Variables, and select Add variable in the CI/CD Variables table.
-
Add the environment variables, and assign them values.
It is also necessary to set the two following environment variables for use in GitLab CI:
Variable Required Description FT_API_KEYYes An API key for the Fluid Topics portal to publish to. API keys with one of the following roles can upload a release notes archive:ADMINKHUB_ADMINCONTENT_PUBLISHER(if the user has permission to publish content through anftmlsource).
For more information on how to create a Fluid Topics API key, see API keys.FT_PORTALYes The URL for the Fluid Topics portal to publish to. -
Create a
cifolder at the root of the repository. - Upload the
auto_rn_ft.pyPython script in thecifolder. - Upload a version of
ftpubending withlinux-amd64in thecifolder. - Create a
.gitlab-ci.ymlat the root of the repository. -
Copy and paste the following codeblock in the
.gitlab-ci.ymlfile:image: python auto_jira_rn: before_script: - pip3 install jira jinja2 pypandoc_binary --break-system-packages script: - python3 ci/auto_rn_ft.py --project "FT" --version-prefix "5.2" --title "My Product Release Notes" --output "rn.zip" - 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} ${FT_PORTAL} artifacts: paths: - rn.zip rules: - if: '$CI_PIPELINE_SOURCE == "web"' -
Replace the default argument values for the
auto_rn_ft.py.For more information on the arguments for the
auto_rn_ft.pyscript, see Run the script. -
Save the file.