GitLab CI/CD - Fluid Topics - Latest

Automatic Release Notes from Jira to Fluid Topics

Category
How To
Audience
public
Version
Latest

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.

  1. In a GitLab repository, go to Settings, and open the CI/CD menu.
  2. Select Variables, and select Add variable.
  3. 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 a ftml source).
  4. Create a ci folder at the root of the repository.

  5. Upload the auto_rn_ft.py Python script in the ci folder.
  6. Upload a version of ftpub ending with linux-amd64 in the ci folder.

    To download ftpub, see Fluid Topics Publisher (ftpub).

  7. Create a .gitlab-ci.yml at the root of the repository.

  8. 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
    
  9. Replace https://$REPLACE_WITH_A_FLUID_TOPICS_PORTAL_ADDRESS.com with the portal on which to publish the release notes.

  10. Save.
  11. Go to the CI/CD menu, and open the Pipelines menu.
  12. Select Run pipeline.
  13. Select Run pipeline again.
  14. Open the Administration menu of the Fluid Topics portal, and select Knowledge Hub.

    The release notes are uploading.