gcb

package
v0.17.9 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const StringSliceSeparator = "..."

StringSliceSeparator is the separator used for passing string slices as GCB substitutions.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCB

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

GCB is the main structure of this package.

func New

func New(options *Options) *GCB

New creates a new `*GCB` instance.

func (*GCB) SetGCBSubstitutions

func (g *GCB) SetGCBSubstitutions(toolOrg, toolRepo, toolRef, gcsBucket, forceBuildKrel string) (map[string]string, error)

SetGCBSubstitutions takes a set of `Options` and returns a map of GCB substitutions.

func (*GCB) SetListJobsClient

func (g *GCB) SetListJobsClient(client ListJobs)

SetListJobsClient can be used to set the internal `ListJobs` client.

func (*GCB) SetReleaseClient

func (g *GCB) SetReleaseClient(client Release)

SetReleaseClient can be used to set the internal `Release` client.

func (*GCB) SetRepoClient

func (g *GCB) SetRepoClient(client Repository)

SetRepoClient can be used to set the internal `Repository` client.

func (*GCB) SetVersionClient

func (g *GCB) SetVersionClient(client Version)

SetVersionClient can be used to set the internal `Version` client.

func (*GCB) Submit

func (g *GCB) Submit() error

Submit is the main method responsible for submitting release jobs to GCB.

type History

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

History is the main structure for retrieving the GCB history output.

func NewHistory

func NewHistory(opts *HistoryOptions) *History

NewHistory creates a new `History` instance.

func (*History) Run

func (h *History) Run() error

RunHistory is the function invoked by 'krel history', responsible for getting the jobs and builind the list of commands to be added in the GitHub issue.

func (*History) SetImpl

func (h *History) SetImpl(impl historyImpl)

SetImpl can be used to set the internal History implementation.

type HistoryOptions

type HistoryOptions struct {
	// Branch is the release branch for filtering the jobs.
	Branch string

	// Project is the GCB project to be used.
	Project string

	// DateFrom is the string date for selecting the start of the range.
	DateFrom string

	// DateTo is the string date for selecting the end of the range.
	DateTo string
}

HistoryOptions are the main settings for the `History`.

func NewHistoryOptions

func NewHistoryOptions() *HistoryOptions

NewHistoryOptions creates a new default HistoryOptions instance.

type ListJobs

type ListJobs interface {
	ListJobs(project string, lastJobs int64) error
}

type Options

type Options struct {
	build.Options

	// NonInteractive does not ask any questions if set to true.
	NonInteractive bool

	NoMock        bool
	Stage         bool
	Release       bool
	FastForward   bool
	Stream        bool
	BuildAtHead   bool
	Branch        string
	ReleaseType   string
	BuildVersion  string
	GcpUser       string
	LogLevel      string
	CustomK8SRepo string
	CustomK8sOrg  string
	LastJobs      int64

	// OpenBuildService parameters
	OBSStage         bool
	OBSRelease       bool
	SpecTemplatePath string
	Packages         []string
	Version          string
	Architectures    []string
	OBSProject       string
	PackageSource    string
	OBSWait          bool
}

func NewDefaultOptions

func NewDefaultOptions() *Options

NewDefaultOptions returns a new default `*Options` instance.

func (*Options) Validate

func (o *Options) Validate() error

Validate checks if the Options are valid.

type Release

type Release interface {
	NeedsCreation(
		branch, releaseType string, buildVersion semver.Version,
	) (createReleaseBranch bool, err error)
	GenerateReleaseVersion(
		releaseType, version, branch string, branchFromMaster bool,
	) (*release.Versions, error)
}

type Repository

type Repository interface {
	Open() error
	CheckState(string, string, string, bool) error
	GetTag() (string, error)
}

type Version

type Version interface {
	GetKubeVersionForBranch(release.VersionType, string) (string, error)
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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