build

package
v0.0.0-...-0d7ca9c Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: Apache-2.0 Imports: 10 Imported by: 8

Documentation

Overview

Package build implements a common system for building kubernetes for deployers to use.

Index

Constants

This section is empty.

Variables

View Source
var (
	CommonTestBinaries = []string{
		"kubectl",
		"e2e.test",
		"ginkgo",
	}
)

Functions

func StoreCommonBinaries

func StoreCommonBinaries(kuberoot string, outroot string)

StoreCommonBinaries will best effort try to store commonly built binaries to the output directory

Types

type Bazel

type Bazel struct {
	RepoRoot      string
	StageLocation string
	ImageLocation string
}

func (*Bazel) Build

func (b *Bazel) Build() (string, error)

func (*Bazel) Stage

func (b *Bazel) Stage(version string) error

type BuildAndStageStrategy

type BuildAndStageStrategy string //nolint:revive

ignore package name stutter

const (

	// MakeStrategy builds using make and (optionally) stages using krel
	MakeStrategy BuildAndStageStrategy = "make"
)

type Builder

type Builder interface {
	// Build determines how kubernetes artifacts are built from sources or existing artifacts
	// and returns the version being built
	Build() (string, error)
}

type Krel

type Krel struct {
	StageLocation   string
	ImageLocation   string
	RepoRoot        string
	StageExtraFiles bool
	UpdateLatest    bool
}

func (*Krel) Stage

func (rpb *Krel) Stage(version string) error

Stage stages the build to GCS using essentially release/push-build.sh --bucket=B --ci --gcs-suffix=S --noupdatelatest

type MakeBuilder

type MakeBuilder struct {
	RepoRoot        string
	TargetBuildArch string
}

func (*MakeBuilder) Build

func (m *MakeBuilder) Build() (string, error)

Build builds kubernetes with the quick-release make target

type NoopBuilder

type NoopBuilder struct{}

func (*NoopBuilder) Build

func (n *NoopBuilder) Build() (string, error)

type NoopStager

type NoopStager struct{}

func (*NoopStager) Stage

func (n *NoopStager) Stage(string) error

type Options

type Options struct {
	Strategy           string `flag:"~strategy" desc:"Determines the build strategy to use either make or bazel."`
	StageLocation      string `flag:"~stage" desc:"Upload binaries to gs://bucket/ci/job-suffix if set"`
	RepoRoot           string `flag:"-"`
	ImageLocation      string `flag:"~image-location" desc:"Image registry where built images are stored."`
	StageExtraGCPFiles bool   `flag:"-"`
	VersionSuffix      string `flag:"-"`
	UpdateLatest       bool   `flag:"~update-latest" desc:"Whether should upload the build number to the GCS"`
	TargetBuildArch    string `flag:"~target-build-arch" desc:"Target architecture for the test artifacts for dockerized build"`
	Builder
	Stager
}

func (*Options) Validate

func (o *Options) Validate() error

type Stager

type Stager interface {
	// Stage determines how kubernetes artifacts will be staged (e.g. to say a GCS bucket)
	// for the specified version
	Stage(version string) error
}

Jump to

Keyboard shortcuts

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