packer-cn/builder/vmware/iso/artifact.go

46 lines
873 B
Go
Raw Normal View History

2013-12-24 00:58:41 -05:00
package iso
2013-06-06 18:12:54 -04:00
import (
"fmt"
)
2013-06-06 18:12:54 -04:00
const (
ArtifactConfFormat = "artifact.conf.format"
ArtifactConfKeepRegistered = "artifact.conf.keep_registered"
ArtifactConfSkipExport = "artifact.conf.skip_export"
)
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 {
builderId string
2017-07-27 20:59:11 -04:00
id string
dir OutputDir
f []string
config map[string]string
2013-06-06 18:12:54 -04: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)
}
func (a *Artifact) State(name string) interface{} {
return a.config[name]
}
func (a *Artifact) Destroy() error {
return a.dir.RemoveAll()
}