ctx

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	NewVersion      version.Semver
	PreviousVersion version.Semver
}

App version information.

type Author

type Author struct {
	Name  string
	Email string
}

Author information for the committer.

type Chart

type Chart struct {
	Name            string
	SubPath         string
	File            File
	NewVersion      version.Semver
	PreviousVersion version.Semver
}

Chart version, metadata, and contents information.

type Context

type Context struct {
	context.Context
	Config *v1.Config
	Out    io.Writer

	Token           string
	PublishStrategy strategies.PublishStrategy
	UpdateStrategy  strategies.UpdateStrategy

	App        App
	Author     Author
	Chart      Chart
	Client     client.Client
	Files      []File
	Git        Git
	Repository Repository
	Release    Release

	// CurrentFile holds a reference to a extras file that is currently being
	// worked on when publishing changes. This allows template rendering to
	// access information about the file, e.g. .CurrentFile.Path
	CurrentFile File

	AllowDirty bool
	DryRun     bool
	ShowDiff   bool
	// contains filtered or unexported fields
}

Context holds information that is used by chart-releaser throughout the update process. Its values get populated and updated as various stages operate on it. It holds all release state.

func New

func New(config *v1.Config) *Context

New creates a new v1 Context for the given v1 Config.

func NewWithTimeout

func NewWithTimeout(config *v1.Config, timeout time.Duration) (*Context, context.CancelFunc)

NewWithTimeout creates a new v1 Context for the given v1 Config, with an timeout to cancel the context.

func Wrap

func Wrap(ctx context.Context, config *v1.Config) *Context

Wrap an existing context.Context into a v1 Context.

func (*Context) CheckDryRun

func (ctx *Context) CheckDryRun(err error) error

CheckDryRun checks whether the Context is configured for a dry-run, and if so, to only log the provided error. If it is not in a dry-run state, it will return the same error it was given for the caller to propagate appropriately.

func (*Context) Dump

func (ctx *Context) Dump()

Dump the Context to console.

func (*Context) Errors

func (ctx *Context) Errors() error

Errors returns the errors collected by the Context.

func (*Context) PrintErrors

func (ctx *Context) PrintErrors()

PrintErrors prints any errors encountered and collected by the Context's error collector.

type File

type File struct {
	Path             string
	PreviousContents []byte
	NewContents      []byte
}

File holds basic data about a file, its previous contents, and its updated contents.

func (*File) HasChanges

func (f *File) HasChanges() bool

HasChanges determines whether the previous contents of the file differ from the new contents of the file.

type Git

type Git struct {
	Tag  string
	Ref  string
	Base string
}

Git information used for publishing chart updates.

type Release

type Release struct {
	PRTitle         string
	PRBody          string
	ChartCommitMsg  string
	ExtrasCommitMsg string
	Matches         []*regexp.Regexp
	Ignores         []*regexp.Regexp
}

Release metadata used for generating the release messages (commits, PRs).

type RepoType

type RepoType string

RepoType defines the type of repository container the Helm Chart.

const (
	RepoGithub RepoType = "github"
)

RepoTypes supported by chart-releaser

func ListRepoTypes

func ListRepoTypes() []RepoType

ListRepoTypes returns all of the RepoTypes supported by chart-releaser.

func RepoTypeFromString

func RepoTypeFromString(s string) (RepoType, error)

RepoTypeFromString gets a RepoType corresponding to a string.

type Repository

type Repository struct {
	Type  RepoType
	Owner string
	Name  string
}

Repository metadata.

Jump to

Keyboard shortcuts

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