-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathartifact.go
41 lines (33 loc) · 878 Bytes
/
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
37
38
39
40
41
package vmm
import (
"fmt"
"os"
)
// Artifact contains references to the things that a build has created.
type Artifact struct {
directory string
files []string
}
// BuilderId returns the ID of the builder that is used to create this artifact.
func (artifact *Artifact) BuilderId() string {
return BuilderId
}
// Files returns a list of files in this artifact.
func (artifact *Artifact) Files() []string {
return artifact.files
}
// Id of this artifact.
func (artifact *Artifact) Id() string {
return "VMM"
}
func (artifact *Artifact) String() string {
return fmt.Sprintf("VM files in directory: %s", artifact.files)
}
// State returns builder-specific state information.
func (artifact *Artifact) State(name string) interface{} {
return nil
}
// Destroy this artifact.
func (artifact *Artifact) Destroy() error {
return os.RemoveAll(artifact.directory)
}