build

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: Apache-2.0, MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultGoBuildBaseImage = "golang:1.16-buster"
)
View Source
const (
	DefaultNodeBuildBaseImage = "node:16-buster"
)
View Source
const GoDockerfileTemplate = `` /* 3868-byte string literal not displayed */
View Source
const NodeDockerfileTemplate = `` /* 140-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerGenericBuilder

type DockerGenericBuilder struct {
	Enabled bool
}

func (*DockerGenericBuilder) Build

Build builds a testplan written in Go and outputs a Docker container.

func (*DockerGenericBuilder) ConfigType

func (*DockerGenericBuilder) ConfigType() reflect.Type

func (*DockerGenericBuilder) ID

func (*DockerGenericBuilder) Purge added in v0.5.3

func (*DockerGenericBuilder) Purge(ctx context.Context, testplan string, ow *rpc.OutputWriter) error

type DockerGenericBuilderConfig

type DockerGenericBuilderConfig struct {
	// Custom base path where we find the test source
	Path      string             `toml:"path" default:"./"`
	BuildArgs map[string]*string `toml:"build_args"` // ok if nil
}

type DockerGoBuilder

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

DockerGoBuilder builds the test plan as a go-based container.

func (*DockerGoBuilder) Build

Build builds a testplan written in Go and outputs a Docker container.

func (*DockerGoBuilder) ConfigType

func (*DockerGoBuilder) ConfigType() reflect.Type

func (*DockerGoBuilder) ID

func (*DockerGoBuilder) ID() string

func (*DockerGoBuilder) Purge added in v0.5.3

func (b *DockerGoBuilder) Purge(ctx context.Context, testplan string, ow *rpc.OutputWriter) error

func (*DockerGoBuilder) TerminateAll added in v0.5.3

func (b *DockerGoBuilder) TerminateAll(ctx context.Context, ow *rpc.OutputWriter) error

type DockerGoBuilderConfig

type DockerGoBuilderConfig struct {
	Enabled    bool
	ModulePath string `toml:"module_path"`
	ExecPkg    string `toml:"exec_pkg"`
	FreshGomod bool   `toml:"fresh_gomod"`

	// Custom base path where we find the test source
	Path string `toml:"path" default:"./"`

	// Custom modfile
	Modfile string `toml:"modfile"`

	// GoProxyMode specifies one of "local", "direct", "remote".
	//
	//   * The "local" mode (default) will start a proxy container (if one
	//     doesn't exist yet) with bridge networking, and will configure the
	//     build to use that proxy.
	//   * The "direct" mode sets the `GOPROXY=direct` env var on the go build.
	//   * The "remote" mode specifies a custom proxy. The `GoProxyURL` field
	//     must be non-empty.
	GoProxyMode string `toml:"go_proxy_mode"`

	// GoProxyURL specifies the URL of the proxy when GoProxyMode = "custom".
	GoProxyURL string `toml:"go_proxy_url"`

	// RuntimeImage is the runtime image that the test plan binary will be
	// copied into. Defaults to busybox:1.31.1-glibc.
	RuntimeImage string `toml:"runtime_image"`

	// BuildBaseImage is the base build image that the test plan binary will be
	// built from. Defaults to golang:1.16-buster
	BuildBaseImage string `toml:"build_base_image"`

	// SkipRuntimeImage allows you to skip putting the build output in a
	// slimmed-down runtime image. The build image will be emitted instead.
	SkipRuntimeImage bool `toml:"skip_runtime_image"`

	// EnableGoBuildCache enables the creation of a go build cache and its usage.
	// When enabling for the first time, a cache image will be created with the
	// dependencies of the current plan state.
	//
	// If this flag is unset or false, every build of a test plan will start
	// with a blank go container. If this flag is true, the builder will the last
	// cached image.
	EnableGoBuildCache bool `toml:"enable_go_build_cache"`

	// Cgo enables the creation of Go packages that call C code. By default it is disabled.
	// Enabling CGO also enables dynamic linking. Disabling CGO (default) produces statically
	// linked binaries.
	//
	// If you ever see errors like the following, you are probably better off
	// disabling CGO (and therefore enabling static linking).
	//
	//   /testplan: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
	// If you pass `true` to this flag, your test plan will be built with CGO_ENABLED=1
	EnableCGO bool `toml:"enable_cgo"`

	// DockefileExtensions enables plans to inject custom Dockerfile directives.
	DockerfileExtensions DockerfileExtensions `toml:"dockerfile_extensions"`
}

type DockerNodeBuilder added in v0.6.0

type DockerNodeBuilder struct{}

func (DockerNodeBuilder) Build added in v0.6.0

func (DockerNodeBuilder) ConfigType added in v0.6.0

func (d DockerNodeBuilder) ConfigType() reflect.Type

func (DockerNodeBuilder) ID added in v0.6.0

func (d DockerNodeBuilder) ID() string

func (DockerNodeBuilder) Purge added in v0.6.0

func (d DockerNodeBuilder) Purge(ctx context.Context, testplan string, ow *rpc.OutputWriter) error

type DockerNodeBuilderConfig added in v0.6.0

type DockerNodeBuilderConfig struct {
	Enabled   bool
	BaseImage string `toml:"base_image"`
}

type DockerfileExtensions

type DockerfileExtensions struct {
	PreModDownload  string `toml:"pre_mod_download"`
	PostModDownload string `toml:"post_mod_download"`
	PreSourceCopy   string `toml:"pre_source_copy"`
	PostSourceCopy  string `toml:"post_source_copy"`
	PreBuild        string `toml:"pre_build"`
	PostBuild       string `toml:"post_build"`
	PreRuntimeCopy  string `toml:"pre_runtime_copy"`
	PostRuntimeCopy string `toml:"post_runtime_copy"`
}

type DockerfileTemplateVars

type DockerfileTemplateVars struct {
	WithSDK              bool
	RuntimeImage         string
	DockerfileExtensions DockerfileExtensions
	SkipRuntimeImage     bool
	CgoEnabled           int
}

type ExecGoBuilder

type ExecGoBuilder struct{}

ExecGoBuilder (id: "exec:go") is a builder that compiles the test plan into an executable using the system Go SDK. The resulting artifact can be used with a containerless runner.

func (*ExecGoBuilder) Build

Build builds a testplan written in Go and outputs an executable.

func (*ExecGoBuilder) ConfigType

func (*ExecGoBuilder) ConfigType() reflect.Type

func (*ExecGoBuilder) ID

func (*ExecGoBuilder) ID() string

func (*ExecGoBuilder) Purge added in v0.5.3

func (*ExecGoBuilder) Purge(ctx context.Context, testplan string, ow *rpc.OutputWriter) error

type ExecGoBuilderConfig

type ExecGoBuilderConfig struct {
	ModulePath string `toml:"module_path"`
	ExecPkg    string `toml:"exec_pkg"`
	FreshGomod bool   `toml:"fresh_gomod"`
}

Jump to

Keyboard shortcuts

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