mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-20 23:11:40 -04:00
* [COMPLIANCE] Add/Update Copyright Headers * make generate update * make generate --------- Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Co-authored-by: sanya <[email protected]> Co-authored-by: Sanya <[email protected]>
40 lines
607 B
Go
40 lines
607 B
Go
// Copyright IBM Corp. 2024, 2026
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package compress
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
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 {
|
|
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)
|
|
}
|