|
|
|
|
@ -2,19 +2,18 @@ package vagrantcloud
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
"os"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const BuilderId = "pearkes.post-processor.vagrant-cloud"
|
|
|
|
|
|
|
|
|
|
type Artifact struct {
|
|
|
|
|
Path string
|
|
|
|
|
Tag string
|
|
|
|
|
Provider string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewArtifact(provider, path string) *Artifact {
|
|
|
|
|
func NewArtifact(provider, tag string) *Artifact {
|
|
|
|
|
return &Artifact{
|
|
|
|
|
Path: path,
|
|
|
|
|
Tag: tag,
|
|
|
|
|
Provider: provider,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -24,7 +23,7 @@ func (*Artifact) BuilderId() string {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (a *Artifact) Files() []string {
|
|
|
|
|
return []string{a.Path}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (a *Artifact) Id() string {
|
|
|
|
|
@ -32,9 +31,9 @@ func (a *Artifact) Id() string {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (a *Artifact) String() string {
|
|
|
|
|
return fmt.Sprintf("'%s' provider box: %s", a.Provider, a.Path)
|
|
|
|
|
return fmt.Sprintf("'%s': %s", a.Provider, a.Tag)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (a *Artifact) Destroy() error {
|
|
|
|
|
return os.Remove(a.Path)
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|