builder

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// NameFilterAttribute is the attribute's filter value to filter by name
	NameFilterAttribute = "name"
	// DriverFilterAttribute is the attribute's filter value to filter by driver
	DriverFilterAttribute = "driver"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	Name       string          `yaml:"name"`
	Driver     string          `yaml:"driver"`
	Options    *BuilderOptions `yaml:"options"`
	VarMapping varsmap.Varsmap `yaml:"variables_mapping"`
}

Builder serializes each builder defined on user configuration

func NewBuilder

func NewBuilder(name, driver string, options *BuilderOptions, varmap varsmap.Varsmap) *Builder

NewBuilder creates a new builder

func NewBuilderFromByteArray

func NewBuilderFromByteArray(data []byte) (*Builder, error)

NewBuilderFromByteArray creates a new builder from a byte array

func NewBuilderFromIOReader

func NewBuilderFromIOReader(reader io.Reader) (*Builder, error)

NewBuilderFromIOReader creates a new builder from an io reader

func (*Builder) CombineVarsmap added in v0.11.2

func (b *Builder) CombineVarsmap(mapping varsmap.Varsmap) error

CombineVarsmap combines the current varsmap with a new one

func (*Builder) WithDriver

func (b *Builder) WithDriver(driver string)

WithDriver sets the driver of the builder

func (*Builder) WithName

func (b *Builder) WithName(name string)

WithName sets the name of the builder

func (*Builder) WithOptions

func (b *Builder) WithOptions(options *BuilderOptions)

WithOptions sets the options of the builder

func (*Builder) WithVarMapping

func (b *Builder) WithVarMapping(mapping varsmap.Varsmap)

WithVarMapping sets the variable mapping of the builder

type BuilderOptions

type BuilderOptions struct {
	// AnsiblePlaybookDriverOptions are the options that can be set on a builder for ansible-playbook driver
	Playbook  string `yaml:"playbook"`
	Inventory string `yaml:"inventory"`
	// DockerDriverOptions are the options that can be set on a builder for docker driver
	Dockerfile string `yaml:"dockerfile"`
	// Context    []*DockerDriverContextOptions `yaml:"context"`
	Context interface{} `yaml:"context"`
}

BuilderOptions are the options that can be set on a builder

func (*BuilderOptions) GetContext

func (o *BuilderOptions) GetContext() ([]*DockerDriverContextOptions, error)

type DockerDriverContextOptions

type DockerDriverContextOptions struct {
	Path string                         `yaml:"path"`
	Git  *DockerDriverGitContextOptions `yaml:"git"`
}

DockerDriverContextOptions are the context definitions to build a docker image

type DockerDriverGitContextAuthOptions

type DockerDriverGitContextAuthOptions struct {
	// Username is the username to use for basic authentication and used for git over http
	Username string `yaml:"username"`
	// Password is the password to use for basic authentication for git over http
	Password string `yaml:"password"`
	// GitSSHUser is the git ssh user to use for ssh authentication
	GitSSHUser string `yaml:"git_ssh_user"`
	// PrivateKeyFile is the path to the private key to use for ssh authentication
	PrivateKeyFile string `yaml:"private_key_file"`
	// PrivateKeyPassword is the password to use for the private key
	PrivateKeyPassword string `yaml:"private_key_password"`
	// CredentialsID is the id of the credentials on credentials store to use to authenticate to the git repository
	CredentialsID string `yaml:"credentials_id"`
}

DockerDriverGitContextAuthOptions defines the authentication for a git context

type DockerDriverGitContextOptions

type DockerDriverGitContextOptions struct {
	// Path must be set when docker build context is located in a subpath inside the repository
	Path string `yaml:"path"`
	// Repository which will be used as docker build context
	Repository string `yaml:"repository"`
	// Reference is the name of the branch to clone. By default is used 'master'
	Reference string `yaml:"reference"`
	// Auth is the authentication configuration for the repository
	Auth *DockerDriverGitContextAuthOptions `yaml:"auth"`
}

DockerDriverGitContextOptions defines a build context from a git repository

Jump to

Keyboard shortcuts

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