builder

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: GPL-3.0, MPL-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT.

Index

Constants

View Source
const BuilderId = "angdraug.nspawn"

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

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

func (*Artifact) BuilderId

func (*Artifact) BuilderId() string

func (*Artifact) Destroy

func (a *Artifact) Destroy() error

func (*Artifact) Files

func (a *Artifact) Files() []string

func (*Artifact) Id

func (a *Artifact) Id() string

func (*Artifact) State

func (a *Artifact) State(name string) interface{}

func (*Artifact) String

func (a *Artifact) String() string

type Builder

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

func (*Builder) ConfigSpec

func (b *Builder) ConfigSpec() hcldec.ObjectSpec

func (*Builder) Prepare

func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error)

func (*Builder) Run

func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (packer.Artifact, error)

type Communicator

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

func (*Communicator) Download

func (c *Communicator) Download(src string, w io.Writer) error

func (*Communicator) DownloadDir

func (c *Communicator) DownloadDir(src string, dst string, exclude []string) error

func (*Communicator) Start

func (c *Communicator) Start(ctx context.Context, remote *packer.RemoteCmd) error

func (*Communicator) Upload

func (c *Communicator) Upload(dst string, r io.Reader, fi *os.FileInfo) error

func (*Communicator) UploadDir

func (c *Communicator) UploadDir(dst string, src string, exclude []string) error

type Config

type Config struct {
	common.PackerConfig `mapstructure:",squash"`

	// Import container image from a URL, file, or a directory tree, in a
	// format recognized by import-* and pull-* commands of machinectl(1).
	Import string `mapstructure:"import"`
	// Name of a local container to clone. When neither import nor clone
	// options are set, a new image will be created with debootstrap(8).
	Clone string `mapstructure:"clone"`
	// Distribution release code name as recognized by debootstrap(8).
	// The default is `unstable`.
	Suite string `mapstructure:"suite"`
	// URL for the distribution mirror.
	// The default is https://deb.debian.org/debian.
	Mirror string `mapstructure:"mirror"`
	// Absolute path to a directory where .deb files will be cached.
	// The default is the host's APT cache at `/var/cache/apt/archives`.
	CacheDir string `mapstructure:"cache_dir"`
	// Absolute path to the directory where systemd-nspawn expects to find
	// the container chroots. The default is `/var/lib/machines`.
	MachinesDir string `mapstructure:"machines_dir"`
	// The bootstrap script variant as recognized by debootstrap(8).
	Variant string `mapstructure:"variant"`
	// The timeout in seconds to wait for the container to start.
	// The default is 20 seconds.
	Timeout time.Duration `mapstructure:"timeout"`
	// contains filtered or unexported fields
}

func (*Config) FlatMapstructure

func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatConfig. FlatConfig is an auto-generated flat version of Config. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

func (*Config) Prepare

func (c *Config) Prepare(raws ...interface{}) error

type ExecWrapper

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

func (*ExecWrapper) Read

func (e *ExecWrapper) Read(w io.Writer, args ...string) error

func (*ExecWrapper) Run

func (e *ExecWrapper) Run(args ...string) error

func (*ExecWrapper) WaitFor

func (e *ExecWrapper) WaitFor(match string, args ...string) (chan bool, error)

func (*ExecWrapper) Write

func (e *ExecWrapper) Write(r io.Reader, args ...string) error

type FlatConfig

type FlatConfig struct {
	PackerBuildName     *string           `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"`
	PackerBuilderType   *string           `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"`
	PackerDebug         *bool             `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"`
	PackerForce         *bool             `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"`
	PackerOnError       *string           `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"`
	PackerUserVars      map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"`
	PackerSensitiveVars []string          `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"`
	Import              *string           `mapstructure:"import" cty:"import" hcl:"import"`
	Clone               *string           `mapstructure:"clone" cty:"clone" hcl:"clone"`
	Suite               *string           `mapstructure:"suite" cty:"suite" hcl:"suite"`
	Mirror              *string           `mapstructure:"mirror" cty:"mirror" hcl:"mirror"`
	CacheDir            *string           `mapstructure:"cache_dir" cty:"cache_dir" hcl:"cache_dir"`
	MachinesDir         *string           `mapstructure:"machines_dir" cty:"machines_dir" hcl:"machines_dir"`
	Variant             *string           `mapstructure:"variant" cty:"variant" hcl:"variant"`
	Timeout             *string           `mapstructure:"timeout" cty:"timeout" hcl:"timeout"`
}

FlatConfig is an auto-generated flat version of Config. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatConfig) HCL2Spec

func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a Config. This spec is used by HCL to read the fields of Config. The decoded values from this spec will then be applied to a FlatConfig.

type Machine

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

func (*Machine) Chroot

func (m *Machine) Chroot(args ...string) error

func (*Machine) Clone

func (m *Machine) Clone(base string) error

func (*Machine) CopyFrom

func (m *Machine) CopyFrom(src string, dst string) error

func (*Machine) CopyTo

func (m *Machine) CopyTo(src string, dst string) error

func (*Machine) Exists

func (m *Machine) Exists() bool

func (*Machine) Import

func (m *Machine) Import(image string) error

func (*Machine) Path

func (m *Machine) Path() string

func (*Machine) Read

func (m *Machine) Read(src string, w io.Writer) error

func (*Machine) Remove

func (m *Machine) Remove() error

func (*Machine) Run

func (m *Machine) Run(args ...string) error

func (*Machine) RunAndWait

func (m *Machine) RunAndWait(command string, marker string) error

func (*Machine) RunLocal

func (m *Machine) RunLocal(args ...string) error

func (*Machine) Start

func (m *Machine) Start() error

func (*Machine) Stop

func (m *Machine) Stop() error

func (*Machine) Write

func (m *Machine) Write(dst string, r io.Reader) error

type StepClone

type StepClone struct{}

func (*StepClone) Cleanup

func (s *StepClone) Cleanup(state multistep.StateBag)

func (*StepClone) Run

type StepDebootstrap

type StepDebootstrap struct{}

func (*StepDebootstrap) Cleanup

func (s *StepDebootstrap) Cleanup(state multistep.StateBag)

func (*StepDebootstrap) Run

type StepImport

type StepImport struct{}

func (*StepImport) Cleanup

func (s *StepImport) Cleanup(state multistep.StateBag)

func (*StepImport) Run

type StepPrepareTarget

type StepPrepareTarget struct{}

func (*StepPrepareTarget) Cleanup

func (s *StepPrepareTarget) Cleanup(state multistep.StateBag)

func (*StepPrepareTarget) Run

type StepProvision

type StepProvision struct{}

func (*StepProvision) Cleanup

func (s *StepProvision) Cleanup(state multistep.StateBag)

func (*StepProvision) Run

Jump to

Keyboard shortcuts

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