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