Bitbucket Server (Stash)
Stash scm
On this page
Description
The Bitbucket Server (Stash) scm plugin is used to manage git repositories hosted on Bitbucket Server (Stash), 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
Name | Type | Description | Required |
---|---|---|---|
branch | string | “branch” defines the git branch to work on. compatible:
default: main remark: depending on which resource references the Stash 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_ | |
commitmessage | object | “commitMessage” is used to generate the final commit message. compatible:
remark: it’s worth mentioning that the commit message settings is applied to all targets linked to the same scm. | |
body | string | “body” defines the commit body of the commit message as defined by the conventional commit specification. More information on -> https://www.conventionalcommits.org/en/
| |
footers | string | footers defines the footer of the commit message as defined by the conventional commit specification. More information on -> https://www.conventionalcommits.org/en/
| |
hidecredit | boolean | “hideCredit” defines if updatecli credits should be displayed inside commit message body
| |
scope | string | “scope” defines the scope of the commit message as defined by the conventional commit specification. More information on -> https://www.conventionalcommits.org/en/
| |
title | string | “title” defines the title of the commit message as defined by the conventional commit specification. More information on -> https://www.conventionalcommits.org/en/
| |
type | string | “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/
| |
directory | string | “directory” defines the local path where the git repository is cloned. compatible:
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:
The default value is based on your local temporary directory like: (on Linux)
/tmp/updatecli/stash/ | |
string | “email” defines the email used to commit changes. compatible:
default: default set to your global git configuration | ||
force | boolean | “force” is used during the git push phase to run compatible:
default: false remark: When force is set to true, Updatecli also recreate the working branches that diverged from their base branch. | |
gpg | object | “gpg” specifies the GPG key and passphrased used for commit signing
| |
passphrase | string | passphrase defines the gpg passphrase used to sign the commit message | |
signingkey | string | signingKey defines the gpg key used to sign the commit message
| |
owner | string | “owner” defines the owner of a repository.
| |
password | string | “password” specifies the credential used to authenticate with Bitbucket Server API, it must be combined with “username” 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
https://github.com/getsops/sops | |
repository | string | repository specifies the name of a repository for a specific owner.
| |
submodules | boolean | “submodules” defines if Updatecli should checkout submodules. compatible: * scm default: true | |
token | string | “token” specifies the credential used to authenticate with Bitbucket Server API 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
https://github.com/getsops/sops | |
url | string | “url” specifies the default stash url in case of Bitbucket Server | |
user | string | “user” specifies the user associated with new git commit messages created by Updatecli
| |
username | string | “username” specifies the username used to authenticate with Bitbucket Server API | |
workingbranch | boolean | “workingBranch” defines if Updatecli should use a temporary branch to work on.
If set to compatible: * scm default: true |
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
Name | Required | Default | Description |
---|---|---|---|
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.
Name | Required | Default | Description |
---|---|---|---|
signingkey | Defines the armored private gpg key | ||
password | Defines the gpg key password |
Example
# updatecli.yaml
---
name: Test Bitbucket Server (Stash) scm
scms:
stash:
kind: stash
spec:
url: "https://bitbucket.exmaple.com"
owner: "olblak"
repository: "updatecli-mirror"
branch: "main"
username: "user"
token: "123456789ABCDEFGHI"
sources:
license:
name: Retrieve license file content
kind: file
scmid: stash
spec:
file: LICENSE