gittag

package
v0.116.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitTag

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

GitTag defines a resource of kind "gittag"

func New

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

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

func (*GitTag) Changelog

func (gt *GitTag) Changelog(from, to string) *result.Changelogs

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

func (*GitTag) Condition

func (gt *GitTag) Condition(_ context.Context, source string, scm scm.ScmHandler) (pass bool, message string, err error)

Condition checks that a git tag exists

func (*GitTag) ReportConfig added in v0.99.0

func (gt *GitTag) ReportConfig() interface{}

ReportConfig returns a new configuration object with only the necessary fields to identify the resource without any sensitive information and context specific data.

func (*GitTag) Source

func (gt *GitTag) Source(_ context.Context, workingDir string, resultSource *result.Source) error

Source returns the latest git tag based on create time

func (*GitTag) Target

func (gt *GitTag) Target(_ context.Context, source string, scm scm.ScmHandler, dryRun bool, resultTarget *result.Target) error

Target creates a tag if needed from a local git repository, without pushing the tag

func (*GitTag) Validate

func (gt *GitTag) Validate() error

Validate tests that tag struct is correctly configured

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"`
	// Tag defines the git tag to check for exact match.
	//
	// compatible:
	//   * condition
	//
	// When specified, the condition will check for an exact tag match
	// instead of using versionFilter pattern matching.
	Tag string `yaml:",omitempty"`
	//  Message associated to the git tag
	//
	//  compatible:
	//    * target
	Message string `yaml:",omitempty"`
	//  "key" of the tag object to retrieve.
	//
	//  Accepted values: ['name','hash'].
	//
	//  Default: 'name'
	//  Compatible:
	//    * source
	Key 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
	//
	//    it's possible to specify git tags without cloning the repository by using the `lsremote` option,
	//    in that case the URL is required and the tags will be retrieved from the remote repository directly without cloning it.
	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"`
	// "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.
	//
	// default: main
	SourceBranch string `yaml:",omitempty"`

	LsRemote *bool `yaml:",omitempty"`
	// Depth is used to limit the number of commits fetched from the git repository.
	//
	// compatible:
	//  * source
	//  * condition
	//  * target
	//
	//  default: 0 (no limit)
	//
	// remark:
	//  * Updatecli won't be able to find tags that are not included in the fetched commits.
	Depth *int `yaml:",omitempty"`
}

Spec defines a specification for a "gittag" 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