Documentation ¶
Index ¶
- Constants
- Variables
- type DefaultRelease
- func (d *DefaultRelease) CheckPrerequisites() error
- func (d *DefaultRelease) CheckReleaseBranchState() error
- func (d *DefaultRelease) CheckoutOBSProject() error
- func (d *DefaultRelease) GenerateOBSProject() error
- func (d *DefaultRelease) GenerateReleaseVersion() error
- func (d *DefaultRelease) InitOBSRoot() error
- func (d *DefaultRelease) InitState()
- func (d *DefaultRelease) ReleasePackages() error
- func (d *DefaultRelease) SetImpl(impl releaseImpl)
- func (d *DefaultRelease) SetState(state *ReleaseState)
- func (d *DefaultRelease) Submit(stream bool) error
- func (d *DefaultRelease) ValidateOptions() error
- type DefaultStage
- func (d *DefaultStage) CheckPrerequisites() error
- func (d *DefaultStage) CheckReleaseBranchState() error
- func (d *DefaultStage) CheckoutOBSProject() error
- func (d *DefaultStage) GenerateOBSProject() error
- func (d *DefaultStage) GeneratePackageArtifacts() error
- func (d *DefaultStage) GeneratePackageVersion()
- func (d *DefaultStage) GenerateReleaseVersion() error
- func (d *DefaultStage) InitOBSRoot() error
- func (d *DefaultStage) InitState()
- func (d *DefaultStage) Push() error
- func (d *DefaultStage) SetImpl(impl stageImpl)
- func (d *DefaultStage) SetState(state *StageState)
- func (d *DefaultStage) State() *StageState
- func (d *DefaultStage) Submit(stream bool) error
- func (d *DefaultStage) ValidateOptions() error
- func (d *DefaultStage) Wait() error
- type Options
- type PrerequisitesChecker
- type PrerequisitesCheckerOptions
- type Release
- type ReleaseOptions
- type ReleaseState
- type Stage
- type StageOptions
- type StageState
- type State
Constants ¶
const ( // OBSKubernetesProject is name of the organization/project on openSUSE's // OBS instance where packages are built and published. OBSKubernetesProject = "isv:kubernetes" // OBSNamespaceStable is part of the subproject name that's used for stable // packages. OBSNamespaceStable = "stable" // OBSNamespaceStable is part of the subproject name that's used for // prerelease (alpha, beta, rc) packages. OBSNamespacePrerelease = "prerelease" // OBSPasswordKey is name of the environment variable with password for // Kubernetes Release Bot account. OBSPasswordKey = "OBS_PASSWORD" // OBSUsernameKey is name of the environment variable containing the // username for the OBS account. If empty, obsK8sUsername will be used. OBSUsernameKey = "OBS_USERNAME" )
Variables ¶
var DefaultPrerequisitesCheckerOptions = &PrerequisitesCheckerOptions{ CheckOBSPassword: true, }
Functions ¶
This section is empty.
Types ¶
type DefaultRelease ¶
type DefaultRelease struct {
// contains filtered or unexported fields
}
DefaultRelease is the default release 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
CheckPrerequisites checks if all prerequisites for the release process are met.
func (*DefaultRelease) CheckReleaseBranchState ¶
func (d *DefaultRelease) CheckReleaseBranchState() error
func (*DefaultRelease) CheckoutOBSProject ¶
func (d *DefaultRelease) CheckoutOBSProject() error
CheckoutOBSProject checks out the OBS project.
func (*DefaultRelease) GenerateOBSProject ¶
func (d *DefaultRelease) GenerateOBSProject() error
GenerateOBSProject generates the OBS project name for the release. Uses the project from the options if set, otherwise generates the project name based on the release type.
func (*DefaultRelease) GenerateReleaseVersion ¶
func (d *DefaultRelease) GenerateReleaseVersion() error
func (*DefaultRelease) InitOBSRoot ¶
func (d *DefaultRelease) InitOBSRoot() error
InitOBSRoot creates the OBS root directory and the OBS config file.
func (*DefaultRelease) InitState ¶
func (d *DefaultRelease) InitState()
func (*DefaultRelease) ReleasePackages ¶
func (d *DefaultRelease) ReleasePackages() error
ReleasePackage publishes successful builds into the maintenance project.
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) ValidateOptions ¶
func (d *DefaultRelease) ValidateOptions() error
ValidateOptions validates the release options.
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) CheckPrerequisites ¶
func (d *DefaultStage) CheckPrerequisites() error
CheckPrerequisites checks if all prerequisites for the stage process are met.
func (*DefaultStage) CheckReleaseBranchState ¶
func (d *DefaultStage) CheckReleaseBranchState() error
func (*DefaultStage) CheckoutOBSProject ¶
func (d *DefaultStage) CheckoutOBSProject() error
CheckoutOBSProject checks out the OBS project.
func (*DefaultStage) GenerateOBSProject ¶
func (d *DefaultStage) GenerateOBSProject() error
GenerateOBSProject generates the OBS project name for the release. Uses the project from the options if set, otherwise generates the project name based on the release type.
func (*DefaultStage) GeneratePackageArtifacts ¶
func (d *DefaultStage) GeneratePackageArtifacts() error
GeneratePackageArtifacts generates the spec file and artifacts archive for packages that are built.
func (*DefaultStage) GeneratePackageVersion ¶
func (d *DefaultStage) GeneratePackageVersion()
GeneratePackageVersion generates the package version for the release. Uses the version from the options if set, otherwise uses the prime version.
func (*DefaultStage) GenerateReleaseVersion ¶
func (d *DefaultStage) GenerateReleaseVersion() error
func (*DefaultStage) InitOBSRoot ¶
func (d *DefaultStage) InitOBSRoot() error
InitOBSRoot creates the OBS root directory and the OBS config file.
func (*DefaultStage) InitState ¶
func (d *DefaultStage) InitState()
func (*DefaultStage) Push ¶
func (d *DefaultStage) Push() error
Push pushes changes to OpenBuildService which triggers the build.
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) State ¶
func (d *DefaultStage) State() *StageState
State returns the internal state.
func (*DefaultStage) Submit ¶
func (d *DefaultStage) Submit(stream bool) error
func (*DefaultStage) ValidateOptions ¶
func (d *DefaultStage) ValidateOptions() error
ValidateOptions validates the stage options.
func (*DefaultStage) Wait ¶ added in v0.16.2
func (d *DefaultStage) Wait() error
Wait waits for the OBS build results to succeed.
type Options ¶
type Options struct { // Workspace is the root workspace. Workspace string // Run the whole process in non-mocked mode. Which means that it doesn't // push specs and artifacts to OpenBuildService. NoMock bool // SpecTemplatePath is path to a directory with spec template files. SpecTemplatePath string // Packages that should be built and published to OpenBuildService. Packages []string // Architectures for which packages should be built. Architectures []string // The release type for which packages are built for. // Can be either `alpha`, `beta`, `rc` or `official`. // Mutually exclusive with `Version`, `Project` and `Source`. ReleaseType string // The release branch for which the release should be built. // Can be `master`/`main` or any `release-x.y` branch. // Mutually exclusive with `Version`, `Project` and `Source`. ReleaseBranch string // The build version to be released. Has to be specified in the format: // `vX.Y.Z-[alpha|beta|rc].N.C+SHA` // Mutually exclusive with `Version`, `Project` and `Source`. BuildVersion string // Version of packages to build. Same version is used for all provided // packages. // Mutually exclusive with `ReleaseType`, `ReleaseBranch`, and // `BuildVersion`. Version string // Project is name of the OBS project where packages are built. // Mutually exclusive with `ReleaseType`, `ReleaseBranch`, and // `BuildVersion`. Project string // PackageSource is https:// or gs:// URL where to download binaries for // packages from. // Mutually exclusive with `ReleaseType`, `ReleaseBranch`, and // `BuildVersion`. PackageSource string // Wait can be used to wait for the OBS build results. Wait bool }
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) ValidateBuildVersion ¶
ValidateBuildVersion validates the provided build version.
type PrerequisitesChecker ¶
type PrerequisitesChecker struct {
// contains filtered or unexported fields
}
PrerequisitesChecker is the main type for checking the prerequisites for OBS operations.
func NewPrerequisitesChecker ¶
func NewPrerequisitesChecker() *PrerequisitesChecker
NewPrerequisitesChecker creates a new PrerequisitesChecker instance.
func (*PrerequisitesChecker) Options ¶
func (p *PrerequisitesChecker) Options() *PrerequisitesCheckerOptions
Options return the options from the prereq checker.
func (*PrerequisitesChecker) Run ¶
func (p *PrerequisitesChecker) Run(workdir string) error
func (*PrerequisitesChecker) SetImpl ¶
func (p *PrerequisitesChecker) SetImpl(impl prerequisitesCheckerImpl)
SetImpl can be used to set the internal PrerequisitesChecker implementation.
type PrerequisitesCheckerOptions ¶
type PrerequisitesCheckerOptions struct {
CheckOBSPassword bool
}
Type prerequisites checker.
type Release ¶
type Release struct {
// contains filtered or unexported fields
}
Release is the structure to be used for releasing staged OBS builds.
func NewRelease ¶
func NewRelease(options *ReleaseOptions) *Release
NewRelease creates a new `Release` instance.
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.
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 packages.
func NewStage ¶
func NewStage(options *StageOptions) *Stage
NewStage creates a new `Stage` instance.
func (*Stage) Run ¶
Run for the `Stage` struct prepares a release and pushes specs and archives to OpenBuildService.
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.
type StageState ¶
type StageState struct {
*State
}
StageState holds the stage process state.
func DefaultStageState ¶
func DefaultStageState() *StageState
DefaultStageState create a new default `StageState`.
Directories ¶
Path | Synopsis |
---|---|
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
specsfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |