packer/post-processor/compress/artifact.go

40 lines
606 B
Go
Raw Permalink Normal View History

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package compress
import (
"fmt"
"os"
)
2015-06-10 17:04:24 -04:00
const BuilderId = "packer.post-processor.compress"
type Artifact struct {
Path string
}
func (a *Artifact) BuilderId() string {
return BuilderId
}
func (*Artifact) Id() string {
return ""
}
func (a *Artifact) Files() []string {
2015-06-18 08:13:48 -04:00
return []string{a.Path}
}
func (a *Artifact) String() string {
return fmt.Sprintf("compressed artifacts in: %s", a.Path)
}
func (*Artifact) State(name string) interface{} {
return nil
}
func (a *Artifact) Destroy() error {
return os.Remove(a.Path)
}