2013-12-24 00:58:41 -05:00
|
|
|
package iso
|
2013-06-06 18:12:54 -04:00
|
|
|
|
2013-06-18 19:01:14 -04:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
2013-06-06 18:12:54 -04:00
|
|
|
|
|
|
|
// Artifact is the result of running the VMware builder, namely a set
|
|
|
|
// of files associated with the resulting machine.
|
|
|
|
type Artifact struct {
|
2013-11-18 19:10:55 -05:00
|
|
|
builderId string
|
2013-12-25 13:27:53 -05:00
|
|
|
dir OutputDir
|
2013-11-18 19:10:55 -05:00
|
|
|
f []string
|
2013-06-06 18:12:54 -04:00
|
|
|
}
|
|
|
|
|
2013-11-18 19:10:55 -05:00
|
|
|
func (a *Artifact) BuilderId() string {
|
|
|
|
return a.builderId
|
2013-06-06 18:12:54 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *Artifact) Files() []string {
|
|
|
|
return a.f
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*Artifact) Id() string {
|
|
|
|
return "VM"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *Artifact) String() string {
|
|
|
|
return fmt.Sprintf("VM files in directory: %s", a.dir)
|
|
|
|
}
|
2013-06-18 19:01:14 -04:00
|
|
|
|
|
|
|
func (a *Artifact) Destroy() error {
|
2013-12-25 13:27:53 -05:00
|
|
|
return a.dir.RemoveAll()
|
2013-06-18 19:01:14 -04:00
|
|
|
}
|