Skip to main content

Utility for use in gitlab ci to generate changelogs.

Project description

gitlab-release-note-generator

===============

Special thanks to gitlab-release. Most of the code used in this project is based on gitlab-release.

This Python utility is used to generate a markdown changelog in the form:

### Release note (2021-02-09 12:19:16)

#### [](#closed-issues)Closed issues

-   Adds initial gitlab yaml [(#1)]

#### [](#merged-merge-requests)Merged merge requests

-   Resolve "Adds initial gitlab yaml" [(#1)]

It can be used in a .gitlab-ci.yml stage like:

::

release:  
  stage: release  
  image: python3  
  script:  
    - pip3 install gitlab-release gitlab-release-notes-generator 
    - Output=$(gitlab-release-notes-generator --private-token $GITLAB_ACCESS_TOKEN)
    - gitlab-release --description "${Output}" --zip "release-${CI_COMMIT_TAG}.zip" *
  only:  
    - tags  

Setting up the required private token

This tool requires you to put a copy of a PRIVATE_TOKEN in a
secret CI variable for the project to give it access to post the files
back to the project.

For this create a new Personal Access Token at
https://gitlab.com/profile/personal_access_tokens and use that. (You
could also use your personal token from
https://gitlab.com/profile/account, but this is not recommended.)

Make sure you enable Access your API when creating the token. The
name of the token is just for you to remeber what it's for, it wont
affeect operation.

Add it to a secret variable called PRIVATE_TOKEN for the project you’re
building at https://gitlab.com/<user>/<project>/settings/ci_cd>.

Usage

::

usage: gitlab-release-note-generator [-h] [--server SERVER] [--project-id PROJECT_ID]
                                          [--private-token PRIVATE_TOKEN] [-f FILE] 

============================= =====
optional arguments
============================= =====

Argument Description
--server SERVER Url of gitlab server
(default: $CI_PROJECT_URL)
--project-id Unique id of project, available in Project. Settings/General
(default: $CI_PROJECT_ID)
--private-token Login token with permissions to commit to repo
(default: $PRIVATE_TOKEN)
-f, --file The changelog file, which shall be written.
(default: stdout)
-h, --help Show this help message and exit
============================= =====

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitlab_release_notes_generator-1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file gitlab_release_notes_generator-1-py3-none-any.whl.

File metadata

  • Download URL: gitlab_release_notes_generator-1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for gitlab_release_notes_generator-1-py3-none-any.whl
Algorithm Hash digest
SHA256 8272d53df7c90de7fd10c21215848e0c1c321ce52d872bf38f936c4eeb8b744d
MD5 e9ac9372b4c417d8921311c92d278ed9
BLAKE2b-256 ab39a285819261fad8586e333f75811a6e945e63412ab28c141518b54ff30878

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page