Commit e00a30e7 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer: Comments on Build interface

parent 4daefc25
......@@ -5,9 +5,21 @@ import "log"
// A Build represents a single job within Packer that is responsible for
// building some machine image artifact. Builds are meant to be parallelized.
type Build interface {
// Name is the name of the build. This is unique across a single template,
// but not absolutely unique. This is meant more to describe to the user
// what is being built rather than being a unique identifier.
Name() string
// Prepare configures the various components of this build and reports
// any errors in doing so (such as syntax errors, validation errors, etc.)
Prepare() error
// Run runs the actual builder, returning an artifact implementation
// of what is built. If anything goes wrong, an error is returned.
Run(Ui, Cache) (Artifact, error)
// Cancel will cancel a running build. This will block until the build
// is actually completely cancelled.
Cancel()
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment