template

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2017 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	Name   string
	Type   string
	Config map[string]interface{}
}

Builder represents a builder configured in the template

func (*Builder) GoString

func (b *Builder) GoString() string

type OnlyExcept

type OnlyExcept struct {
	Only   []string
	Except []string
}

OnlyExcept is a struct that is meant to be embedded that contains the logic required for "only" and "except" meta-parameters.

func (*OnlyExcept) Skip

func (o *OnlyExcept) Skip(n string) bool

Skip says whether or not to skip the build with the given name.

func (*OnlyExcept) Validate

func (o *OnlyExcept) Validate(t *Template) error

Validate validates that the OnlyExcept settings are correct for a thing.

type PostProcessor

type PostProcessor struct {
	OnlyExcept `mapstructure:",squash"`

	Type              string
	KeepInputArtifact bool `mapstructure:"keep_input_artifact"`
	Config            map[string]interface{}
}

PostProcessor represents a post-processor within the template.

func (*PostProcessor) GoString

func (p *PostProcessor) GoString() string

type Provisioner

type Provisioner struct {
	OnlyExcept `mapstructure:",squash"`

	Type        string
	Config      map[string]interface{}
	Override    map[string]interface{}
	PauseBefore time.Duration `mapstructure:"pause_before"`
}

Provisioner represents a provisioner within the template.

func (*Provisioner) GoString

func (p *Provisioner) GoString() string

type Push

type Push struct {
	Name    string
	Address string
	BaseDir string `mapstructure:"base_dir"`
	Include []string
	Exclude []string
	Token   string
	VCS     bool
}

Push represents the configuration for pushing the template to Atlas.

type Template

type Template struct {
	// Path is the path to the template. This will be blank if Parse is
	// used, but will be automatically populated by ParseFile.
	Path string

	Description string
	MinVersion  string

	Variables      map[string]*Variable
	Builders       map[string]*Builder
	Provisioners   []*Provisioner
	PostProcessors [][]*PostProcessor
	Push           Push

	// RawContents is just the raw data for this template
	RawContents []byte
}

Template represents the parsed template that is used to configure Packer builds.

func Parse

func Parse(r io.Reader) (*Template, error)

Parse takes the given io.Reader and parses a Template object out of it.

func ParseFile

func ParseFile(path string) (*Template, error)

ParseFile is the same as Parse but is a helper to automatically open a file for parsing.

func (*Template) Validate

func (t *Template) Validate() error

Validate does some basic validation of the template on top of the validation that occurs while parsing. If possible, we try to defer validation to here. The validation errors that occur during parsing are the minimal necessary to make sure parsing builds a reasonable Template structure.

type Variable

type Variable struct {
	Default  string
	Required bool
}

Variable represents a variable within the template

func (*Variable) GoString

func (v *Variable) GoString() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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