Gitlab Branch

kind: gitlab/branch

sourceconditiontarget

Description

The Gitlab "branch" plugin allows to manipulate Gitlab repository branches.

source

When used as a "source", the Gitlab branch plugin allows to get a Gitlab repository branch according the version filter rule provided.

condition

When used as a "condition". the Gitlab branch plugin allows to test that specific Gitlab branch exist.

target

Target is not supported, feel free to manifest your interest by opening an issue on updatecil/updatecli/issues, or highlighting an existing one.

Parameters

NameTypeDescriptionRequired
branchstring[C] Branch specifies the branch name
ownerstring[S][C] Owner specifies repository owner
repositorystring[S][C] Repository specifies the name of a repository for a specific owner
tokenstring

“token” defines the credential used to authenticate with GitLab

remark: A token is a sensitive information, it’s recommended to not set this value directly in the configuration file but to use an environment variable or a SOPS file.

The value can be set to {{ requiredEnv "GITLAB_TOKEN"}} to retrieve the token from the environment variable GITHUB_TOKEN or {{ .gitlab.token }} to retrieve the token from a SOPS file.

  For more information, about a SOPS file, please refer to the following documentation:

https://github.com/getsops/sops

urlstring

“url” defines the GitLab url to interact with

default: “gitlab.com”

usernamestring“username” defines the username used to authenticate with GitLab
versionfilterobject[S] VersionFilter provides parameters to specify version pattern and its type like regex, semver, or just latest.
    kindstringspecifies the version kind such as semver, regex, or latest
    patternstringspecifies the version pattern according the version kind
    strictbooleanstrict enforce strict versioning rule. Only used for semantic versioning at this time

Example

# updatecli.yaml
name: "Demo Gitlab branch"

sources:
  default:
    kind: "gitlab/branch"
    spec:
      # default to gitlab.com
      # url: "gitlab.com"
      owner: "olblak"
      repository: "updatecli"
      branch: main

conditions:
  default:
    name: Show condition usage without source input
    kind: "gitlab/branch"
    disablesourceinput: true
    spec:
      # default to gitlab.com
      # url: "gitlab.com"
      owner: "olblak"
      repository: "updatecli"
      branch: "main"

  sourcedefault:
    name: Show condition using branch name fetch from source input
    kind: "gitlab/branch"
    sourceid: "default"
    spec:
      # default to gitlab.com
      # url: "gitlab.com"
      owner: "olblak"
      repository: "updatecli-test"

Top