Git

kind: git

Description

The "scm" of kind git, defines parameters to interact with a git repository. It is then referenced from another "resource" by using the key scmID. Depending on the resource that referenced the git configuration, the behavior will change.

source

When a source resource references a scm configuration, then it usually means using a file from that repository.

condition

When a condition references a scm configuration, then it usually means using a file from that repository.

target

When a target references a scm configuration, it usually means pushing file to that repository.

Parameters

NameTypeDescriptionRequired
branchstring

“branch” defines the git branch to work on.

	compatible:
		* scm

	default:
		main

	remark:
		depending on which resource references the GitHub 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 will push any changes to that branch

		For more information, please refer to the following issue:
		https://github.com/updatecli/updatecli/issues/1139
commitmessageobject

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

	compatible:
		* scm

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

	default:
		false
    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/<url>
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
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
passwordstring

“password” specifies the password when using the HTTP protocol

	compatible:
		* scm
submodulesbooleanWhether to checkout submodules: true to checkout submodules or false to skip.
urlstring

“url” specifies the git url

	compatible:
		* scm

	example:
		* git@github.com:updatecli/updatecli.git
		* https://github.com/updatecli/updatecli.git

	remarks:
		when using the ssh protocol, the user must have the right to clone the repository
		based on its local ssh configuration
userstring

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

	compatible:
		* scm
usernamestring

“username” specifies the username when using the HTTP protocol

	compatible
		* scm

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

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

body

Override default body message

Authentication

At the moment they are two ways to authentication with a git repository, either using a username/password` from the updatecli configuration, or relying on the local ssh-agent.

Example

updatecli.yaml

name: "Example with Git SCM"

scms:
  scenario-source:
    kind: git
    spec:
      username: "git username used for authentication"
      password: 'git password used for authentication'
      url: "https://github.com/updatecli/experiment.git"
      branch: "main"

  scenario-condition:
    kind: git
    spec:
      url: "https://github.com/updatecli/updatecli.git"
      branch: "main"

  scenario-target:
    kind: git
    spec:
      url: "git@github.com:updatecli/updatecli.git"
      branch: "main"
      user: "git user to push from changes"
      email: "git user email to push from change"
      commitmessage:
        type: "chore"
        scope: "(deps)"
      gpg:
        signingkey: |
          -----BEGIN PGP PUBLIC KEY BLOCK-----
          mDMEYitSPBYJKwYBBAHaRw8BAQdAR3mMGagDsa1P2HziXehsurCBw5ak58aNnfPP
          uRQtcq60SlVwZGF0ZWNsaSBUZXN0aW5nIEtleSAoVXNlIGZvciB0ZXN0aW5nIGNv
          bW1pdCBzaWduaW5nKSA8aW5mb0B1cGRhdGVjbGkuaW8+iI8EExYKADcWIQSfbrE/
          jBl2/jyNP1zp/q0C4DwCsAUCYitSPAIbAwULCQgHAwQVCgkIBRYDAgEAAh4FAheA
          AAoJEOn+rQLgPAKwbFwBALgzusdciqTZVvzTT/MG9Rtba6FPUUR/3pZn0t5mYrT4
          AQDQjBipUNWOwQ6T7teBJuqZS2hFU6oMDv9cSzjNjrxQArg4BGIrUjwSCisGAQQB
          l1UBBQEBB0CAKp9rGdo2JojPTnq/I2ZqPx8YydCTPDKQzRGv54bSDgMBCAeIeAQY
          FgoAIBYhBJ9usT+MGXb+PI0/XOn+rQLgPAKwBQJiK1I8AhsMAAoJEOn+rQLgPAKw
          fH0A/2ZmCpmuGN4grG8UJwAbCHzrbTuWV456R2k6+MxKMiDmAQD5pOgx+Xs0PXyz
          rxOShppuh5wlhB0xMsx4iZJmRczPDQ==
          =FiJF
          -----END PGP PUBLIC KEY BLOCK-----
        passphrase: updatecli

sources:
  source-1:
    name: "Source 1"
    kind: file
    scmid: scenario-source
    spec:
      file: README.md

conditions:
  condition-1:
    name: "Condition 1"
    kind: file
    scmid: scenario-condition
    spec:
      file: README.md

targets:
  target-1:
    name: "Target 1"
    kind: file
    scmid: scenario-target
    spec:
      file: README.md
Top