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
|
2017-07-27 20:59:11 -04:00
|
|
|
id 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
|
|
|
|
}
|
|
|
|
|
2017-07-27 20:59:11 -04:00
|
|
|
func (a *Artifact) Id() string {
|
|
|
|
return a.id
|
2013-06-06 18:12:54 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *Artifact) String() string {
|
|
|
|
return fmt.Sprintf("VM files in directory: %s", a.dir)
|
|
|
|
}
|
2013-06-18 19:01:14 -04:00
|
|
|
|
2014-01-19 13:32:44 -05:00
|
|
|
func (a *Artifact) State(name string) interface{} {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|