anago

package
v0.17.12 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (

	// The default license for all artifacts.
	LicenseIdentifier = "Apache-2.0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultRelease

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

DefaultRelease is the default staging implementation used in production.

func NewDefaultRelease

func NewDefaultRelease(options *ReleaseOptions) *DefaultRelease

NewDefaultRelease creates a new defaultRelease instance.

func (*DefaultRelease) CheckPrerequisites

func (d *DefaultRelease) CheckPrerequisites() error

func (*DefaultRelease) CheckProvenance added in v0.12.0

func (d *DefaultRelease) CheckProvenance() error

CheckProvenance verifies the artifacts staged in the release bucket by verifying the provenance metadata generated during the stage run.

func (*DefaultRelease) CheckReleaseBranchState

func (d *DefaultRelease) CheckReleaseBranchState() error

func (*DefaultRelease) CreateAnnouncement

func (d *DefaultRelease) CreateAnnouncement() error

CreateAnnouncement creates the announcement.html file.

func (*DefaultRelease) GenerateReleaseVersion

func (d *DefaultRelease) GenerateReleaseVersion() error

func (*DefaultRelease) InitLogFile

func (d *DefaultRelease) InitLogFile() error

func (*DefaultRelease) InitState

func (d *DefaultRelease) InitState()

func (*DefaultRelease) PrepareWorkspace

func (d *DefaultRelease) PrepareWorkspace() error

func (*DefaultRelease) PushArtifacts

func (d *DefaultRelease) PushArtifacts() error

func (*DefaultRelease) PushGitObjects

func (d *DefaultRelease) PushGitObjects() error

PushGitObjects uploads to the remote repository the release's tags and branches. Internally, this function calls the release implementation's PushTags, PushBranches and PushMainBranch methods.

func (*DefaultRelease) SetImpl

func (d *DefaultRelease) SetImpl(impl releaseImpl)

SetImpl can be used to set the internal release implementation.

func (*DefaultRelease) SetState

func (d *DefaultRelease) SetState(state *ReleaseState)

SetState fixes the current state. Mainly used for passing arbitrary values during testing.

func (*DefaultRelease) Submit

func (d *DefaultRelease) Submit(stream bool) error

func (*DefaultRelease) UpdateGitHubPage

func (d *DefaultRelease) UpdateGitHubPage() error

UpdateGitHubPage Update the GitHub release page, uploading the source code.

func (*DefaultRelease) ValidateOptions

func (d *DefaultRelease) ValidateOptions() error

type DefaultStage

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

DefaultStage is the default staging implementation used in production.

func NewDefaultStage

func NewDefaultStage(options *StageOptions) *DefaultStage

NewDefaultStage creates a new defaultStage instance.

func (*DefaultStage) Build

func (d *DefaultStage) Build() error

func (*DefaultStage) CheckPrerequisites

func (d *DefaultStage) CheckPrerequisites() error

func (*DefaultStage) CheckReleaseBranchState

func (d *DefaultStage) CheckReleaseBranchState() error

func (*DefaultStage) GenerateBillOfMaterials added in v0.10.0

func (d *DefaultStage) GenerateBillOfMaterials() error

func (*DefaultStage) GenerateChangelog

func (d *DefaultStage) GenerateChangelog() error

func (*DefaultStage) GenerateReleaseVersion

func (d *DefaultStage) GenerateReleaseVersion() error

func (*DefaultStage) InitLogFile

func (d *DefaultStage) InitLogFile() error

func (*DefaultStage) InitState

func (d *DefaultStage) InitState()

func (*DefaultStage) PrepareWorkspace

func (d *DefaultStage) PrepareWorkspace() error

func (*DefaultStage) SetImpl

func (d *DefaultStage) SetImpl(impl stageImpl)

SetImpl can be used to set the internal stage implementation.

func (*DefaultStage) SetState

func (d *DefaultStage) SetState(state *StageState)

SetState fixes the current state. Mainly used for passing arbitrary values during testing.

func (*DefaultStage) StageArtifacts

func (d *DefaultStage) StageArtifacts() error

func (*DefaultStage) State

func (d *DefaultStage) State() *StageState

State returns the internal state.

func (*DefaultStage) Submit

func (d *DefaultStage) Submit(stream bool) error

func (*DefaultStage) TagRepository

func (d *DefaultStage) TagRepository() error

func (*DefaultStage) ValidateOptions

func (d *DefaultStage) ValidateOptions() error

func (*DefaultStage) VerifyArtifacts added in v0.10.0

func (d *DefaultStage) VerifyArtifacts() error

VerifyArtifacts checks the artifacts to ensure they are correct.

type Options

type Options struct {
	// Run the whole process in non-mocked mode. Which means that it uses
	// production remote locations for storing artifacts and modifying git
	// repositories.
	NoMock bool

	// The release type which should be produced. Can be either `alpha`,
	// `beta`, `rc` or `official`.
	ReleaseType string

	// The release branch for which the release should be build. Can be
	// `master` or any `release-x.y` branch.
	ReleaseBranch string

	// The build version to be released. Has to be specified in the format:
	// `vX.Y.Z-[alpha|beta|rc].N.C+SHA`
	BuildVersion string
}

Options are settings which will be used by `StageOptions` as well as `ReleaseOptions`.

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions returns a new Options instance.

func (*Options) Bucket

func (o *Options) Bucket() string

Bucket returns the Google Cloud Bucket for these `Options`.

func (*Options) ContainerRegistry

func (o *Options) ContainerRegistry() string

ContainerRegistry returns the container registry for these `Options`.

func (*Options) String

func (o *Options) String() string

String returns a string representation for the `ReleaseOptions` type.

func (*Options) Validate

func (o *Options) Validate() error

Validate if the options are correctly set.

func (*Options) ValidateBuildVersion added in v0.15.0

func (o *Options) ValidateBuildVersion(state *State) error

type Release

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

Release is the structure to be used for releasing staged releases.

func NewRelease

func NewRelease(options *ReleaseOptions) *Release

NewRelease creates a new `Release` instance.

func (*Release) Run

func (r *Release) Run() error

Run for `Release` struct finishes a previously staged release.

func (*Release) SetClient

func (r *Release) SetClient(client releaseClient)

SetClient can be used to set the internal stage client.

func (*Release) Submit

func (r *Release) Submit(stream bool) error

Submit can be used to submit a releasing Google Cloud Build (GCB) job.

type ReleaseOptions

type ReleaseOptions struct {
	*Options
}

ReleaseOptions contains the options for running `Release`.

func DefaultReleaseOptions

func DefaultReleaseOptions() *ReleaseOptions

DefaultReleaseOptions create a new default `ReleaseOptions`.

func (*ReleaseOptions) String

func (r *ReleaseOptions) String() string

String returns a string representation for the `ReleaseOptions` type.

func (*ReleaseOptions) Validate

func (r *ReleaseOptions) Validate(state *State) error

Validate if the options are correctly set.

type ReleaseState

type ReleaseState struct {
	*State
}

ReleaseState holds the release process state.

func DefaultReleaseState

func DefaultReleaseState() *ReleaseState

DefaultReleaseState create a new default `ReleaseOptions`.

type Stage

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

Stage is the structure to be used for staging releases.

func NewStage

func NewStage(options *StageOptions) *Stage

NewStage creates a new `Stage` instance.

func (*Stage) Run

func (s *Stage) Run() error

Run for the `Stage` struct prepares a release and puts the results on a staging bucket.

func (*Stage) SetClient

func (s *Stage) SetClient(client stageClient)

SetClient can be used to set the internal stage client.

func (*Stage) Submit

func (s *Stage) Submit(stream bool) error

Submit can be used to submit a staging Google Cloud Build (GCB) job.

type StageOptions

type StageOptions struct {
	*Options
}

StageOptions contains the options for running `Stage`.

func DefaultStageOptions

func DefaultStageOptions() *StageOptions

DefaultStageOptions create a new default `StageOptions`.

func (*StageOptions) String

func (s *StageOptions) String() string

String returns a string representation for the `StageOptions` type.

func (*StageOptions) Validate

func (s *StageOptions) Validate(state *State) error

Validate if the options are correctly set.

type StageState

type StageState struct {
	*State
}

StageState holds the release process state.

func DefaultStageState

func DefaultStageState() *StageState

DefaultStageState create a new default `StageState`.

type State

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

State holds all inferred and calculated values from the release process it's state mutates as each step es executed.

func DefaultState

func DefaultState() *State

DefaultState returns a new empty State.

func (*State) SetCreateReleaseBranch

func (s *State) SetCreateReleaseBranch(createReleaseBranch bool)

func (*State) SetVersions

func (s *State) SetVersions(versions *release.Versions)

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