2018-01-24 06:04:39 -05:00
|
|
|
package common
|
2017-04-16 16:04:50 -04:00
|
|
|
|
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"
|
2017-04-16 16:04:50 -04:00
|
|
|
|
|
|
|
type Artifact struct {
|
2017-07-02 16:29:50 -04:00
|
|
|
Name string
|
2017-08-23 20:06:50 -04:00
|
|
|
VM *driver.VirtualMachine
|
2017-04-16 16:04:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *Artifact) BuilderId() string {
|
|
|
|
return BuilderId
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *Artifact) Files() []string {
|
2017-05-09 10:23:57 -04:00
|
|
|
return []string{}
|
2017-04-16 16:04:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *Artifact) Id() string {
|
2017-07-02 16:29:50 -04:00
|
|
|
return a.Name
|
2017-04-16 16:04:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func (a *Artifact) String() string {
|
2017-07-02 16:29:50 -04:00
|
|
|
return a.Name
|
2017-04-16 16:04:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2017-04-16 16:04:50 -04:00
|
|
|
}
|