Python script which is used to create releases on GitLab
Project description
GitLab Auto Release
An example CI using this can be found here. This package was intended to be used by GitLab CI hence using environments provided by the GitLab CI. You can however use it as a CLI tool if you would like.
Usage
First you need to create a personal access token, more information here. With the scope api, so it can create the release for you.
pip install gitlab-auto-mr
gitlab_auto_release --help
Usage: gitlab_auto_release [OPTIONS]
Gitlab Auto Release Tool.
Options:
--private-token TEXT Private GITLAB token, used to authenticate when
calling the MR API. [required]
--project-url TEXT The project URL on GitLab to create the MR for.
[required]
--project-id INTEGER The project ID on GitLab to create the MR for.
[required]
--tag-name TEXT The tag the release should be created from.
[required]
--release-name TEXT The name of the release. [required]
-c, --changelog TEXT Path to file to changelog file, will overwrite
description with tag matching changelog. Must be in
keepachangelog format.
-d, --description TEXT Path to file to use as the description for the MR.
-a, --asset TEXT An asset to include in the release, i.e.
name=link_to_asset.
--artifacts TEXT Will include artifacts from jobs specified in
current pipeline. Use job name.
--help Show this message and exit.
gitlab_auto_release --private-token xxxx --project-id 8593636 \
--project-url https://gitlab.com/stegappasaurus/stegappasaurus-app \
--tag-name v0.1.0 --release-name v0.1.0 --changelog CHANGELOG.md
GitLab CI
Set a secret variable in your GitLab project with your private token. Name it GITLAB_PRIVATE_TOKEN (CI/CD > Environment Variables). This is necessary to create the release on your behalf. More information click here. An example CI using this can be found here.
Add the following to your .gitlab-ci.yml file:
stages:
- post
publish:release:
image: registry.gitlab.com/gitlab-automation-toolkit/gitlab-auto-release
stage: post
only:
- /^release/.*$/
before_script: []
script:
- gitlab_auto_release --changelog CHANGELOG.md --artifacts lint --artifacts report
Changelog
You can find the changelog here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for gitlab-auto-release-2.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b26f7c5f90bd7ed45bc6b3d91902593dbf5d3e085921ee78022e1872e201a70 |
|
MD5 | 78a9375b12c5b937b6a8dc411c4d9765 |
|
BLAKE2b-256 | 598e6da250ac77a4d5d0f0f502c288954ae588d3cd5ab7ee0e3874fdb6b9284f |