Set up the script in GitLab - Fluid Topics - Latest

Automatic Release Notes from Jira to Fluid Topics

Category
How To
Audience
public
Version
Latest

It is first necessary to set up the GitLab CI job.

To do so:

  1. In a GitLab repository, go to Settings, and open the CI/CD menu.
  2. Select Variables, and select Add variable in the CI/CD Variables table.
  3. 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_KEY Yes 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:
    For more information on how to create a Fluid Topics API key, see API keys.
    FT_PORTAL Yes The URL for the Fluid Topics portal to publish to.
  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.
  7. Create a .gitlab-ci.yml at the root of the repository.
  8. Copy and paste the following codeblock in the .gitlab-ci.yml file:

    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"'
    
  9. Replace the default argument values for the auto_rn_ft.py.

    For more information on the arguments for the auto_rn_ft.py script, see Run the script.

  10. Save the file.