# gitlab-release-note-generator
===============
Special thanks to [gitlab-release](https://gitlab.com/alelec/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 <br/>(default: http://gitlab.com/) |
|``--project-id`` | Unique id of project, available in Project. Settings/General <br/>(default: $CI_PROJECT_ID) |
|``--private-token`` | Login token with permissions to commit to repo <br/>(default: $PRIVATE_TOKEN)|
| ``-f, --file`` |The changelog file, which shall be written. <br/>(default: stdout) |
| ``-h``, ``--help`` |Show this help message and exit |
============================= =====
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/nimpsch/gitlab_release_notes_generator.git",
"name": "gitlab-release-notes-generator",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Sebastian Nimpsch",
"author_email": "snimpsch@gmail.com",
"download_url": "",
"platform": null,
"description": "\n# gitlab-release-note-generator\n===============\n\nSpecial thanks to [gitlab-release](https://gitlab.com/alelec/gitlab-release). Most of the code used in this project is based on gitlab-release.\n\nThis Python utility is used to generate a markdown changelog in the form:\n\n```\n### Release note (2021-02-09 12:19:16)\n\n#### [](#closed-issues)Closed issues\n\n- Adds initial gitlab yaml [(#1)]\n\n#### [](#merged-merge-requests)Merged merge requests\n\n- Resolve \"Adds initial gitlab yaml\" [(#1)]\n```\n\n\n\nIt can be used in a ``.gitlab-ci.yml`` stage like:\n\n::\n\n release:\n stage: release\n image: python3\n script:\n - pip3 install gitlab-release gitlab-release-notes-generator\n - Output=$(gitlab-release-notes-generator --private-token $GITLAB_ACCESS_TOKEN)\n - gitlab-release --description \"${Output}\" --zip \"release-${CI_COMMIT_TAG}.zip\" *\n only:\n - tags\n\n\nSetting up the required private token\n---------------------------------------\n\nThis tool requires you to put a copy of a ``PRIVATE_TOKEN`` in a\nsecret CI variable for the project to give it access to post the files\nback to the project.\n\nFor this create a new `Personal Access Token` at\nhttps://gitlab.com/profile/personal_access_tokens and use that. (You\ncould also use your personal token from\nhttps://gitlab.com/profile/account, but this is `not recommended`.)\n\nMake sure you enable `Access your API` when creating the token. The\n`name` of the token is just for you to remeber what it's for, it wont\naffeect operation.\n\nAdd it to a secret variable called ``PRIVATE_TOKEN`` for the project you\u2019re\nbuilding at ``https://gitlab.com/<user>/<project>/settings/ci_cd>``.\n\n\nUsage\n-----\n::\n\n usage: gitlab-release-note-generator [-h] [--server SERVER] [--project-id PROJECT_ID]\n [--private-token PRIVATE_TOKEN] [-f FILE]\n\n============================= =====\noptional arguments\n============================= =====\n| Argument | Description |\n |--|--|\n |``--server SERVER`` | Url of gitlab server <br/>(default: http://gitlab.com/) |\n |``--project-id`` | Unique id of project, available in Project. Settings/General <br/>(default: $CI_PROJECT_ID) |\n |``--private-token`` | Login token with permissions to commit to repo <br/>(default: $PRIVATE_TOKEN)|\n | ``-f, --file`` |The changelog file, which shall be written. <br/>(default: stdout) |\n| ``-h``, ``--help`` |Show this help message and exit |\n============================= =====\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Utility for use in gitlab ci to generate changelogs.",
"version": "1.3.0",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "4c30b7cc1976dc2b32c45fffa0d2c15e",
"sha256": "8870c8360b4ea28058eede351d8e9aee832f5bb491b50f223a1d433275d4da38"
},
"downloads": -1,
"filename": "gitlab_release_notes_generator-1.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4c30b7cc1976dc2b32c45fffa0d2c15e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 5273,
"upload_time": "2022-12-21T15:05:56",
"upload_time_iso_8601": "2022-12-21T15:05:56.085540Z",
"url": "https://files.pythonhosted.org/packages/95/84/8b25eb3c93d74e5871181226f79f586e37957b52b5afd933c6565051faf6/gitlab_release_notes_generator-1.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-21 15:05:56",
"github": false,
"gitlab": true,
"bitbucket": false,
"gitlab_user": "nimpsch",
"gitlab_project": "gitlab_release_notes_generator.git",
"lcname": "gitlab-release-notes-generator"
}