packer-cn/artifact.go

41 lines
594 B
Go
Raw Normal View History

package main
2017-06-29 18:08:49 -04:00
import (
2017-08-23 20:06:50 -04:00
"github.com/jetbrains-infra/packer-builder-vsphere/driver"
2017-06-29 18:08:49 -04:00
)
2017-06-27 03:55:49 -04:00
const BuilderId = "jetbrains.vsphere"
type Artifact struct {
2017-07-02 16:29:50 -04:00
Name string
2017-08-23 20:06:50 -04:00
VM *driver.VirtualMachine
}
func (a *Artifact) BuilderId() string {
return BuilderId
}
func (a *Artifact) Files() []string {
return []string{}
}
func (a *Artifact) Id() string {
2017-07-02 16:29:50 -04:00
return a.Name
}
func (a *Artifact) String() string {
2017-07-02 16:29:50 -04:00
return a.Name
}
func (a *Artifact) State(name string) interface{} {
return nil
}
func (a *Artifact) Destroy() error {
2017-08-23 20:06:50 -04:00
err := a.VM.Destroy()
2017-06-29 18:08:49 -04:00
if err != nil {
return err
}
2017-08-23 20:06:50 -04:00
return nil
}