gitbranch

package
v0.102.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitBranch

type GitBranch struct {
	// contains filtered or unexported fields
}

GitBranch defines a resource of kind "gitbranch"

func New

func New(spec interface{}) (*GitBranch, error)

New returns a reference to a newly initialized GitBranch object from a Spec or an error if the provided Filespec triggers a validation error.

func (*GitBranch) Changelog

func (gb *GitBranch) Changelog(from, to string) *result.Changelogs

Changelog returns the changelog for this resource, or an empty string if not supported

func (*GitBranch) Condition

func (gb *GitBranch) Condition(source string, scm scm.ScmHandler) (pass bool, message string, err error)

Condition checks that a git branch exists

func (*GitBranch) ReportConfig added in v0.99.0

func (gb *GitBranch) ReportConfig() interface{}

ReportConfig returns a new configuration object with only the necessary fields to identify the resource without any sensitive information

func (*GitBranch) Source

func (gb *GitBranch) Source(workingDir string, resultSource *result.Source) error

Source returns the latest git tag based on create time

func (*GitBranch) Target

func (gb *GitBranch) Target(source string, scm scm.ScmHandler, dryRun bool, resultTarget *result.Target) (err error)

Target creates and pushes a git tag based on the SCM configuration

type Spec

type Spec struct {
	// path contains the git repository path
	Path string `yaml:",omitempty"`
	// VersionFilter provides parameters to specify version pattern and its type like regex, semver, or just latest.
	//
	//  compatible:
	//    * source
	//    * condition
	//    * target
	VersionFilter version.Filter `yaml:",omitempty"`
	// branch specifies the branch name
	//
	//  compatible:
	//    * source
	//    * condition
	//    * target
	Branch string `yaml:",omitempty"`
	//	"url" specifies the git url to use for fetching Git Tags.
	//
	//	compatible:
	//	  * source
	//	  * condition
	// 	  * target
	//
	//	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
	SourceBranch string `yaml:",omitempty"`
	// "sourcebranch" defines the branch name used as a source to create the new Git branch.
	//
	// compatible:
	//  * target
	//
	// remark:
	//  * sourcebranch is required when the scmid is not defined.
	URL string `yaml:",omitempty" jsonschema:"required"`
	//	"username" specifies the username when using the HTTP protocol
	//
	//	compatible
	//	  * source
	//	  * condition
	// 	  * target
	Username string `yaml:",omitempty"`
	//	"password" specifies the password when using the HTTP protocol
	//
	//	compatible:
	//	  * source
	// 	  * condition
	// 	  * target
	Password string `yaml:",omitempty"`
	//  "key" of the tag object to retrieve.
	//
	//  Accepted values: ['name','hash'].
	//
	//  Default: 'name'
	//  Compatible:
	//    * source
	Key string `yaml:",omitempty"`
}

Spec defines a specification for a "gitbranch" resource parsed from an updatecli manifest file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL