build

package
v0.16.9 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 16 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultExtraVersionMarkers = []string{}
View Source
var ExtraGcpStageFiles = []stageFile{
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
}

ExtraGcpStageFiles defines extra GCP files to be staged if `StageExtraFiles` in `Options` is set to `true`.

View Source
var ExtraWindowsStageFiles = []stageFile{
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
}

ExtraWindowsStageFiles defines extra Windows files to be staged if `StageExtraFiles` in `Options` is set to `true`.

Functions

This section is empty.

Types

type Instance

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

Instance is the main structure for creating and pushing builds.

func NewInstance

func NewInstance(opts *Options) *Instance

NewInstance can be used to create a new build `Instance`. TODO: Prefer functional options here instead

func (*Instance) Build

func (bi *Instance) Build() error

Build starts a Kubernetes build with the options defined in the build `Instance`.

func (*Instance) CheckReleaseBucket

func (bi *Instance) CheckReleaseBucket() error

CheckReleaseBucket verifies that a release bucket exists and the current authenticated GCP user has write permissions to it.

func (*Instance) CopyStagedFromGCS

func (bi *Instance) CopyStagedFromGCS(stagedBucket, buildVersion string) error

CopyStagedFromGCS copies artifacts from GCS and between buckets as needed. TODO: Investigate if it's worthwhile to use any of the bi.objStore.Get*Path()

functions here or create a new one to populate staging paths

func (*Instance) DeleteLocalSourceTarball added in v0.12.0

func (bi *Instance) DeleteLocalSourceTarball(workDir string) error

DeleteLocalSourceTarball the deletion of the tarball is now decoupled from StageLocalSourceTree to be able to use it during the anago.stage function

func (*Instance) Push

func (bi *Instance) Push() error

Push pushes the build by taking the internal options into account.

func (*Instance) PushContainerImages

func (bi *Instance) PushContainerImages() error

PushContainerImages will publish container images into the set `Registry`. It also validates if the remove manifests are correct, which can be turned of by setting `ValidateRemoteImageDigests` to `false`.

func (*Instance) PushReleaseArtifacts

func (bi *Instance) PushReleaseArtifacts(srcPath, gcsPath string) error

PushReleaseArtifacts can be used to push local artifacts from the `srcPath` to the remote `gcsPath`. The Bucket has to be set via the `Bucket` option.

func (*Instance) StageLocalArtifacts

func (bi *Instance) StageLocalArtifacts() error

StageLocalArtifacts locally stages the release artifacts

func (*Instance) StageLocalSourceTree

func (bi *Instance) StageLocalSourceTree(workDir, buildVersion string) error

StageLocalSourceTree creates a src.tar.gz from the Kubernetes sources and uploads it to GCS.

type Make

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

Make is the main structure for building Kubernetes releases.

func NewMake

func NewMake() *Make

New creates a new `Build` instance.

func (*Make) MakeCross

func (m *Make) MakeCross(version string) error

MakeCross cross compiles Kubernetes binaries for the provided `versions` and `repoPath`.

func (*Make) SetImpl

func (m *Make) SetImpl(impl impl)

SetImpl can be used to set the internal implementation.

type Options

type Options struct {
	// Specify an alternate bucket for pushes (normally 'devel' or 'ci').
	Bucket string

	// Specify an alternate build directory (relative to RepoRoot). Will be automatically determined
	// if not set.
	BuildDir string

	// Used to make determinations on where to push artifacts
	// Can be overridden using `GCSRoot`.
	//
	// May be one of: 'devel', 'ci', 'release'
	BuildType string

	// If set, push docker images to specified registry/project.
	Registry string

	// Absolute path to the kubernetes repository root directory
	// defaults to current working directory
	RepoRoot string

	// Comma separated list which can be used to upload additional version
	// files to GCS. The path is relative and is append to a GCS path. (--ci
	// only).
	ExtraVersionMarkers []string

	// The top-level GCS directory builds will be released to.
	// If specified, it will override BuildType.
	//
	// When unset:
	//   - BuildType: "ci"
	//   - final path: gs://<bucket>/ci
	//
	// When set:
	//   - BuildType: "ci"
	//   - GCSRoot: "new-root"
	//   - final path: gs://<bucket>/new-root
	//
	// This option exists to handle the now-deprecated GCSSuffix option, which
	// was not plumbed through
	GCSRoot string

	// Version to be used. Usually automatically discovered, but it can be
	// used to overwrite this behavior.
	Version string

	// Append suffix to version name if set.
	VersionSuffix string

	// Used to configure options for CI builds.
	CI bool

	// Configure docker client for gcr.io authentication to allow communication
	// with non-public registries.
	ConfigureDocker bool

	// Specifies a fast build.
	Fast bool

	// Do not exit error if the build already exists on the GCS path.
	AllowDup bool

	// Do not update the latest file.
	NoUpdateLatest bool

	// Do not mark published bits on GCS as publicly readable.
	PrivateBucket bool

	// Validate that the remote image digests exists.
	ValidateRemoteImageDigests bool

	// Stage additional files defined by `ExtraGcpStageFiles` and
	// `ExtraWindowsStageFiles`, otherwise they will be skipped.
	StageExtraFiles bool

	// This sets the KUBE_BUILD_PLATFORMS value for make release/quick-release commands
	KubeBuildPlatforms string
}

Options are the main options to pass to `Instance`.

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