command

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: MPL-2.0 Imports: 119 Imported by: 22

Documentation

Index

Constants

View Source
const TiniestBuilder = `{
	"builders": [
		{
			"type":"null",
			"communicator": "none"
		}
	]
}`

Variables

View Source
var Builders = map[string]packer.Builder{
	"alicloud-ecs":        new(alicloudecsbuilder.Builder),
	"amazon-chroot":       new(amazonchrootbuilder.Builder),
	"amazon-ebs":          new(amazonebsbuilder.Builder),
	"amazon-ebssurrogate": new(amazonebssurrogatebuilder.Builder),
	"amazon-ebsvolume":    new(amazonebsvolumebuilder.Builder),
	"amazon-instance":     new(amazoninstancebuilder.Builder),
	"azure-arm":           new(azurearmbuilder.Builder),
	"azure-chroot":        new(azurechrootbuilder.Builder),
	"cloudstack":          new(cloudstackbuilder.Builder),
	"digitalocean":        new(digitaloceanbuilder.Builder),
	"docker":              new(dockerbuilder.Builder),
	"file":                new(filebuilder.Builder),
	"googlecompute":       new(googlecomputebuilder.Builder),
	"hcloud":              new(hcloudbuilder.Builder),
	"hyperone":            new(hyperonebuilder.Builder),
	"hyperv-iso":          new(hypervisobuilder.Builder),
	"hyperv-vmcx":         new(hypervvmcxbuilder.Builder),
	"jdcloud":             new(jdcloudbuilder.Builder),
	"linode":              new(linodebuilder.Builder),
	"lxc":                 new(lxcbuilder.Builder),
	"lxd":                 new(lxdbuilder.Builder),
	"ncloud":              new(ncloudbuilder.Builder),
	"null":                new(nullbuilder.Builder),
	"oneandone":           new(oneandonebuilder.Builder),
	"openstack":           new(openstackbuilder.Builder),
	"oracle-classic":      new(oracleclassicbuilder.Builder),
	"oracle-oci":          new(oracleocibuilder.Builder),
	"osc-bsu":             new(oscbsubuilder.Builder),
	"osc-bsusurrogate":    new(oscbsusurrogatebuilder.Builder),
	"osc-bsuvolume":       new(oscbsuvolumebuilder.Builder),
	"osc-chroot":          new(oscchrootbuilder.Builder),
	"parallels-iso":       new(parallelsisobuilder.Builder),
	"parallels-pvm":       new(parallelspvmbuilder.Builder),
	"profitbricks":        new(profitbricksbuilder.Builder),
	"proxmox":             new(proxmoxbuilder.Builder),
	"qemu":                new(qemubuilder.Builder),
	"scaleway":            new(scalewaybuilder.Builder),
	"tencentcloud-cvm":    new(tencentcloudcvmbuilder.Builder),
	"triton":              new(tritonbuilder.Builder),
	"ucloud-uhost":        new(uclouduhostbuilder.Builder),
	"vagrant":             new(vagrantbuilder.Builder),
	"virtualbox-iso":      new(virtualboxisobuilder.Builder),
	"virtualbox-ovf":      new(virtualboxovfbuilder.Builder),
	"virtualbox-vm":       new(virtualboxvmbuilder.Builder),
	"vmware-iso":          new(vmwareisobuilder.Builder),
	"vmware-vmx":          new(vmwarevmxbuilder.Builder),
	"yandex":              new(yandexbuilder.Builder),
}
View Source
var ErrSessionExit = errors.New("Session exit")

ErrSessionExit is a special error result that should be checked for from Handle to signal a graceful exit.

Functions

This section is empty.

Types

type BuildCommand

type BuildCommand struct {
	Meta
}

func (*BuildCommand) AutocompleteArgs added in v1.2.4

func (*BuildCommand) AutocompleteArgs() complete.Predictor

func (*BuildCommand) AutocompleteFlags added in v1.2.4

func (*BuildCommand) AutocompleteFlags() complete.Flags

func (*BuildCommand) GetBuilds added in v1.5.0

func (c *BuildCommand) GetBuilds(path string) ([]packer.Build, int)

func (*BuildCommand) GetBuildsFromHCL added in v1.5.0

func (c *BuildCommand) GetBuildsFromHCL(path string) ([]packer.Build, int)

func (*BuildCommand) Help

func (*BuildCommand) Help() string

func (*BuildCommand) ParseArgs added in v1.4.1

func (c *BuildCommand) ParseArgs(args []string) (Config, int)

func (*BuildCommand) Run

func (c *BuildCommand) Run(args []string) int

func (*BuildCommand) RunContext added in v1.4.1

func (c *BuildCommand) RunContext(buildCtx context.Context, args []string) int

func (*BuildCommand) Synopsis

func (*BuildCommand) Synopsis() string

type Config added in v1.4.1

type Config struct {
	Color, Debug, Force, Timestamp bool
	ParallelBuilds                 int64
	OnError                        string
	Path                           string
}

Config is the command-configuration parsed from the command line.

type ConsoleCommand added in v1.4.2

type ConsoleCommand struct {
	Meta
}

func (*ConsoleCommand) AutocompleteArgs added in v1.4.2

func (*ConsoleCommand) AutocompleteArgs() complete.Predictor

func (*ConsoleCommand) AutocompleteFlags added in v1.4.2

func (*ConsoleCommand) AutocompleteFlags() complete.Flags

func (*ConsoleCommand) Help added in v1.4.2

func (*ConsoleCommand) Help() string

func (*ConsoleCommand) Run added in v1.4.2

func (c *ConsoleCommand) Run(args []string) int

func (*ConsoleCommand) Synopsis added in v1.4.2

func (*ConsoleCommand) Synopsis() string

type FixCommand

type FixCommand struct {
	Meta
}

func (*FixCommand) AutocompleteArgs added in v1.2.4

func (c *FixCommand) AutocompleteArgs() complete.Predictor

func (*FixCommand) AutocompleteFlags added in v1.2.4

func (c *FixCommand) AutocompleteFlags() complete.Flags

func (*FixCommand) Help

func (*FixCommand) Help() string

func (*FixCommand) Run

func (c *FixCommand) Run(args []string) int

func (*FixCommand) Synopsis

func (c *FixCommand) Synopsis() string

type FlagSetFlags added in v0.8.0

type FlagSetFlags uint

FlagSetFlags is an enum to define what flags are present in the default FlagSet returned by Meta.FlagSet

const (
	FlagSetNone        FlagSetFlags = 0
	FlagSetBuildFilter FlagSetFlags = 1 << iota
	FlagSetVars
)

type InspectCommand

type InspectCommand struct {
	Meta
}

func (*InspectCommand) AutocompleteArgs added in v1.2.4

func (c *InspectCommand) AutocompleteArgs() complete.Predictor

func (*InspectCommand) AutocompleteFlags added in v1.2.4

func (c *InspectCommand) AutocompleteFlags() complete.Flags

func (*InspectCommand) Help

func (*InspectCommand) Help() string

func (*InspectCommand) Run

func (c *InspectCommand) Run(args []string) int

func (*InspectCommand) Synopsis

func (c *InspectCommand) Synopsis() string

type Meta

type Meta struct {
	CoreConfig *packer.CoreConfig
	Ui         packer.Ui
	Version    string
	// contains filtered or unexported fields
}

Meta contains the meta-options and functionality that nearly every Packer command inherits.

func (*Meta) BuildNames added in v0.8.0

func (m *Meta) BuildNames(c *packer.Core) []string

BuildNames returns the list of builds that are in the given core that we care about taking into account the only and except flags.

func (*Meta) Core added in v0.8.0

func (m *Meta) Core(tpl *template.Template) (*packer.Core, error)

Core returns the core for the given template given the configured CoreConfig and user variables on this Meta.

func (*Meta) FlagSet added in v0.8.0

func (m *Meta) FlagSet(n string, fs FlagSetFlags) *flag.FlagSet

FlagSet returns a FlagSet with the common flags that every command implements. The exact behavior of FlagSet can be configured using the flags as the second parameter, for example to disable build settings on the commands that don't handle builds.

func (*Meta) StdinPiped added in v1.4.2

func (m *Meta) StdinPiped() bool

StdinPiped returns true if the input is piped.

func (*Meta) ValidateFlags added in v0.8.0

func (m *Meta) ValidateFlags() error

ValidateFlags should be called after parsing flags to validate the given flags

type PluginCommand added in v0.9.0

type PluginCommand struct {
	Meta
}

func (*PluginCommand) Help added in v0.9.0

func (*PluginCommand) Help() string

func (*PluginCommand) Run added in v0.9.0

func (c *PluginCommand) Run(args []string) int

func (*PluginCommand) Synopsis added in v0.9.0

func (c *PluginCommand) Synopsis() string

type REPLSession added in v1.4.2

type REPLSession struct {
	// Core is used for constructing interpolations based off packer templates
	Core *packer.Core
}

Session represents the state for a single Read-Evaluate-Print-Loop (REPL) session.

func (*REPLSession) Handle added in v1.4.2

func (s *REPLSession) Handle(line string) (string, error)

Handle a single line of input from the REPL.

The return value is the output and the error to show.

type ValidateCommand

type ValidateCommand struct {
	Meta
}

func (*ValidateCommand) AutocompleteArgs added in v1.2.4

func (*ValidateCommand) AutocompleteArgs() complete.Predictor

func (*ValidateCommand) AutocompleteFlags added in v1.2.4

func (*ValidateCommand) AutocompleteFlags() complete.Flags

func (*ValidateCommand) Help

func (*ValidateCommand) Help() string

func (*ValidateCommand) Run

func (c *ValidateCommand) Run(args []string) int

func (*ValidateCommand) Synopsis

func (*ValidateCommand) Synopsis() string

type VersionCheckFunc

type VersionCheckFunc func() (VersionCheckInfo, error)

VersionCheckFunc is the callback called by the Version command to check if there is a new version of Packer.

type VersionCheckInfo

type VersionCheckInfo struct {
	Outdated bool
	Latest   string
	Alerts   []string
}

VersionCheckInfo is the return value for the VersionCheckFunc callback and tells the Version command information about the latest version of Packer.

type VersionCommand

type VersionCommand struct {
	Meta

	CheckFunc VersionCheckFunc
}

VersionCommand is a Command implementation prints the version.

func (*VersionCommand) Help

func (c *VersionCommand) Help() string

func (*VersionCommand) Run

func (c *VersionCommand) Run(args []string) int

func (*VersionCommand) Synopsis

func (c *VersionCommand) Synopsis() string

Jump to

Keyboard shortcuts

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