packer2terraform

package
Version: v0.0.0-...-6ae71cf Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("No Artifacts found.")

ErrNotFound when there's no artifacts found in the CSV data

View Source
var TemplateAmazonEBS = `variable "images" {
    default = {
{{range .Artifacts}}
        {{index .IDSplit 0}} = "{{index .IDSplit 1}}"{{end}}
    }
}`

A simple terraform template for aws amis in zones

Functions

func ReadCSV

func ReadCSV(csvReader io.Reader) (ret [][]string, err error)

ReadCSV converts the csv files into a data structure we can use

func ToTemplate

func ToTemplate(artifacts []Artifact, tmpl string) (ret string, err error)

ToTemplate applies the artifacts to a given template string

Types

type Artifact

type Artifact struct {
	BuilderTarget string
	BuilderID     string
	ID            string
	IDSplit       []string
	Message       string
	FilesCount    string
}

Artifact is our representation of a Packer.Artifact

func ExtractArtifacts

func ExtractArtifacts(parsed [][]string) (artifacts []Artifact, err error)

ExtractArtifacts extracts Artifacts from array of LogLines

func (*Artifact) ApplyLogLine

func (a *Artifact) ApplyLogLine(line LogLine)

ApplyLogLine uses a LogLine to

type ErrList

type ErrList struct {
	List []string
}

ErrList when there's errors mentioned in the CSV data

func (*ErrList) Add

func (e *ErrList) Add(err string)

Add an error string to the list of errors

func (*ErrList) Error

func (e *ErrList) Error() string

type ErrMissing

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

ErrMissing when artifact-count is higher than the Artifacts found

func (*ErrMissing) Error

func (e *ErrMissing) Error() string

type LogLine

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

LogLine encapsulates a single log line from the csv

func NewLogLine

func NewLogLine(v []string) *LogLine

NewLogLine constructs a LogLine

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL