Gitlab Release
kind: gitlab/release
On this page
source | condition | target |
---|---|---|
✔ | ✔ | ✔ |
Description
The Gitlab "release" plugin allows to manipulate Gitlab releases.
source
When used as a "source", the Gitlab release plugin allows to get a Gitlab Release tag according the version filter rule provided.
condition
When used as a "condition". the Gitlab release plugin allows to test that specific Gitlab Release tag exist.
target
When used a "target", the Gitlab release plugin Using the gitlab/release as a "target" ensures that a Gitlab release exists.
Parameters
Name | Type | Description | Required |
---|---|---|---|
commitish | string | [T] Commitish defines the commit-ish such as `main` | |
draft | boolean | [T] Draft defines if the release is a draft release | |
drescription | string | [T] Drescription defines if the new release description | |
owner | string | [S][C][T] Owner specifies repository owner | |
prerelease | boolean | [T] Prerelease defines if the release is a pre-release release | |
repository | string | [S][C][T]Repository specifies the name of a repository for a specific owner | |
tag | string | [C][T] Tag defines the Gitlab release tag. | |
title | string | [T] Title defines the Gitlab release title. | |
token | string | [S][C][T] Token specifies the credential used to authenticate with | |
url | string | [S][C][T] URL specifies the default github url in case of Gitlab enterprise | |
username | string | [S][C][T] Username specifies the username used to authenticate with Gitlab API | |
versionfilter | object | [S] VersionFilter provides parameters to specify version pattern and its type like regex, semver, or just latest. | |
kind | string | Specifies the version kind such as semver, regex, or latest | |
pattern | string | Specifies the version pattern according the version kind | |
strict | boolean | Strict enforce strict versioning rule. Only used for semantic versioning at this time |
Example
# updatecli.yaml
name: Show Gitlab release usage
sources:
default:
name: Retrieve latest release matching versionfilter rule
kind: gitlab/release
spec:
# url default to gitlab.com if unset
# url: "gitlab.com"
owner: olblak
repository: updatecli
versionfilter:
kind: semver
pattern: "~0"
conditions:
default:
name: Test that release "0.0.2" exist
kind: gitlab/release
spec:
# url default to gitlab.com if unset
# url: "gitlab.com"
owner: olblak
repository: updatecli
tag: "0.2.0"
sourcedefault:
name: Test that release retrieved from source 'default' exist
kind: gitlab/release
sourceid: default
spec:
# url default to gitlab.com if unset
# url: "gitlab.com"
owner: olblak
repository: updatecli
targets:
default:
name: "Ensure release 0.0.1 from branch main exist"
kind: gitlab/release
spec:
# url default to gitlab.com if unset
# url: "gitlab.com"
owner: olblak
repository: updatecli
commitish: main
token: xxx
tag: "0.0.1"
sourcedefault:
name: "Ensure release where tag is retrieved from source 'default' from branch main exist"
kind: gitlab/release
sourceid: default
spec:
# url default to gitlab.com if unset
# url: "gitlab.com"
owner: olblak
repository: updatecli-test
token: xxx
commitish: main