Gitlab

Gitlab scm

Description

The Gitlab scm plugin is used to manage git repositories hosted on Gitlab, depending on the stage, it can be used for different purposes

source: Retrieve data from a git repository, such as a file content condition: Ensure data exist on a git repository, such as a file content target: Ensure data is up to date on a git repository

Parameters

NameTypeDescriptionRequired
branchstring

“branch” defines the git branch to work on.

	compatible:
		* scm

	default:
		main

	remark:
		depending on which resource references the GitLab scm, the behavior will be different.

		If the scm is linked to a source or a condition (using scmid), the branch will be used to retrieve
		file(s) from that branch.

		If the scm is linked to target then Updatecli creates a new "working branch" based on the branch value.
		The working branch created by Updatecli looks like "updatecli_<pipelineID>".
		It is worth mentioning that it is not possible to bypass the working branch in the current situation.
		For more information, please refer to the following issue:
		https://github.com/updatecli/updatecli/issues/1139

		If you need to push changes to a specific branch, you must use the plugin "git" instead of this
commitmessageobject

“commitMessage” is used to generate the final commit message.

	compatible:
		* scm

	remark:
		it's worth mentioning that the commit message settings is applied to all targets linked to the same scm.
    bodystring

“body” defines the commit body of the commit message as defined by the conventional commit specification. More information on -> https://www.conventionalcommits.org/en/

	default:
		none
    footersstring

footers defines the footer of the commit message as defined by the conventional commit specification. More information on -> https://www.conventionalcommits.org/en/

	default:
		none
    hidecreditboolean

“hideCredit” defines if updatecli credits should be displayed inside commit message body

	please consider sponsoring the Updatecli project if you want to disable credits.
	-> https://github.com/updatecli/updatecli

	default:
		false
    scopestring

“scope” defines the scope of the commit message as defined by the conventional commit specification. More information on -> https://www.conventionalcommits.org/en/

	default:
		none
    titlestring

“title” defines the title of the commit message as defined by the conventional commit specification. More information on -> https://www.conventionalcommits.org/en/

	default:
		default is set to the target name or the target short description
		if the name is not defined.
    typestring

“type” defines the type of commit message such as “chore”, “fix”, “feat”, etc. as defined by the conventional commit specification. More information on -> https://www.conventionalcommits.org/en/

	default:
		* chore
directorystring

“directory” defines the local path where the git repository is cloned.

	compatible:
		* scm

	remark:
		Unless you know what you are doing, it is recommended to use the default value.
		The reason is that Updatecli may automatically clean up the directory after a pipeline execution.

	default:
		/tmp/updatecli/gitlab/<owner>/<repository>
emailstring

“email” defines the email used to commit changes.

	compatible:
		* scm

	default:
		default set to your global git configuration
forceboolean

“force” is used during the git push phase to run git push --force.

	compatible:
		* scm

	default:
		false
gpgobject

“gpg” specifies the GPG key and passphrased used for commit signing

	compatible:
		* scm
    passphrasestringpassphrase defines the gpg passphrase used to sign the commit message
    signingkeystring

signingKey defines the gpg key used to sign the commit message

	default:
		none
ownerstring

“owner” defines the owner of a repository.

	compatible:
		* scm
repositorystring

repository specifies the name of a repository for a specific owner.

	compatible:
		* action
		* scm
tokenstring“token” defines the credential used to authenticate with GitLab
urlstring

“url” defines the GitLab url to interact with

	default:
		url defaults to "gitlab.com"
userstring

“user” specifies the user associated with new git commit messages created by Updatecli

	compatible:
		* scm
usernamestring“username” defines the username used to authenticate with GitLab

CommitMessage

Updatecli uses conventional commits as describe on www.conventionnalcommits.org.
The goal is to add human and machine readable meaning to commit messages

By default, Updatecli generates a commit message using the default type "chore" and split long title message into the body like:


Author: olblak <updatecli@updatecli.io>
Date:   Tue May 4 15:41:44 2021 +0200

    chore: Update key "dependencies[0].version" from file "charts/jenkins/r...

    ... equirements.yaml"

    Made with ❤️️  by updatecli

NameRequiredDefaultDescription

type

chore

Specify commit type

scope

Specify commit scope

footer

Specify commit footer message

title

Override default body message

hideCredit

Remove "Made with ❤️️ by updatecli" from commit message

body

Override default body message

GPG

Updatecli can sign commits using a private GPG key if configured accordingly.


NameRequiredDefaultDescription

signingkey

Defines the armored private gpg key

password

Defines the gpg key password

Example

# updatecli.yaml
---
name: Show Gitlab scm

scms:
  gitlab:
    kind: gitlab
    spec:
      # By default url is set to gitlab.com
      # url: gitlab.com
      owner: "olblak"
      repository: "updatecli"
      branch: main

sources:
  license:
    name: Retrieve license file content
    kind: file
    scmid: gitlab
    spec:
      file: LICENSE

Top