From e00a30e729f8b89a4e583aa840fc6b13a4480845 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 14 Jun 2013 12:15:51 -0700 Subject: [PATCH] packer: Comments on Build interface --- packer/build.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packer/build.go b/packer/build.go index 5261da8b2..3f4bf8df0 100644 --- a/packer/build.go +++ b/packer/build.go @@ -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() }