Documentation
¶
Index ¶
- type Gitlab
- func (g *Gitlab) Add(files []string) error
- func (g *Gitlab) Checkout() error
- func (g *Gitlab) Clean() error
- func (g *Gitlab) Clone() (string, error)
- func (g *Gitlab) Commit(message string) error
- func (g *Gitlab) GetBranches() (sourceBranch, workingBranch, targetBranch string)
- func (g *Gitlab) GetChangedFiles(workingDir string) ([]string, error)
- func (g *Gitlab) GetDirectory() (directory string)
- func (g *Gitlab) GetURL() string
- func (g *Gitlab) IsRemoteBranchUpToDate() (bool, error)
- func (g *Gitlab) Push() error
- func (g *Gitlab) PushBranch(branch string) error
- func (g *Gitlab) PushTag(tag string) error
- func (g *Gitlab) SearchTags() (tags []string, err error)
- type Spec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gitlab ¶
type Gitlab struct {
// Spec contains inputs coming from updatecli configuration
Spec Spec
// contains filtered or unexported fields
}
Gitlab contains information to interact with GitLab api
func (*Gitlab) GetBranches ¶ added in v0.53.0
GetBranches returns the source, working and target branches.
func (*Gitlab) GetChangedFiles ¶
GetChangedFiles returns a list of changed files
func (*Gitlab) GetDirectory ¶
GetDirectory returns the local git repository path.
func (*Gitlab) IsRemoteBranchUpToDate ¶
IsRemoteBranchUpToDate checks if the branch reference name is published on on the default remote
func (*Gitlab) Push ¶
Push run `git push` to the corresponding GitLab remote branch if not already created.
func (*Gitlab) SearchTags ¶
SearchTags retrieves git tags from a remote gitlab repository
type Spec ¶
type Spec struct {
client.Spec `yaml:",inline,omitempty"`
/*
"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.
*/
CommitMessage commit.Commit `yaml:",omitempty"`
/*
"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>
*/
Directory string `yaml:",omitempty"`
/*
"email" defines the email used to commit changes.
compatible:
* scm
default:
default set to your global git configuration
*/
Email string `yaml:",omitempty"`
/*
"force" is used during the git push phase to run `git push --force`.
compatible:
* scm
default:
false
*/
Force bool `yaml:",omitempty"`
/*
"gpg" specifies the GPG key and passphrased used for commit signing
compatible:
* scm
*/
GPG sign.GPGSpec `yaml:",omitempty"`
/*
"owner" defines the owner of a repository.
compatible:
* scm
*/
Owner string `yaml:",omitempty" jsonschema:"required"`
/*
repository specifies the name of a repository for a specific owner.
compatible:
* action
* scm
*/
Repository string `yaml:",omitempty" jsonschema:"required"`
/*
"user" specifies the user associated with new git commit messages created by Updatecli
compatible:
* scm
*/
User string `yaml:",omitempty"`
/*
"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
*/
Branch string `yaml:",omitempty"`
// Whether to checkout submodules: `true` to checkout submodules or `false` to skip.
Submodules *bool `yaml:",omitempty"`
}
Spec defines settings used to interact with GitLab release
Click to show internal directories.
Click to hide internal directories.