github.com/askholme/packer@v0.7.2-0.20140924152349-70d9566a6852/packer/artifact.go (about)

     1  package packer
     2  
     3  // An Artifact is the result of a build, and is the metadata that documents
     4  // what a builder actually created. The exact meaning of the contents is
     5  // specific to each builder, but this interface is used to communicate back
     6  // to the user the result of a build.
     7  type Artifact interface {
     8  	// Returns the ID of the builder that was used to create this artifact.
     9  	// This is the internal ID of the builder and should be unique to every
    10  	// builder. This can be used to identify what the contents of the
    11  	// artifact actually are.
    12  	BuilderId() string
    13  
    14  	// Returns the set of files that comprise this artifact. If an
    15  	// artifact is not made up of files, then this will be empty.
    16  	Files() []string
    17  
    18  	// The ID for the artifact, if it has one. This is not guaranteed to
    19  	// be unique every run (like a GUID), but simply provide an identifier
    20  	// for the artifact that may be meaningful in some way. For example,
    21  	// for Amazon EC2, this value might be the AMI ID.
    22  	Id() string
    23  
    24  	// Returns human-readable output that describes the artifact created.
    25  	// This is used for UI output. It can be multiple lines.
    26  	String() string
    27  
    28  	// Destroy deletes the artifact. Packer calls this for various reasons,
    29  	// such as if a post-processor has processed this artifact and it is
    30  	// no longer needed.
    31  	Destroy() error
    32  }