2013-06-17 14:56:26 -04:00
|
|
|
package packer
|
|
|
|
|
2020-11-19 14:54:31 -05:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
)
|
2019-03-22 09:56:02 -04:00
|
|
|
|
2013-06-17 14:56:26 -04:00
|
|
|
// A PostProcessor is responsible for taking an artifact of a build
|
|
|
|
// and doing some sort of post-processing to turn this into another
|
|
|
|
// artifact. An example of a post-processor would be something that takes
|
|
|
|
// the result of a build, compresses it, and returns a new artifact containing
|
|
|
|
// a single file of the prior artifact compressed.
|
|
|
|
type PostProcessor interface {
|
2020-12-01 17:48:55 -05:00
|
|
|
HCL2Speccer
|
2019-12-17 05:25:56 -05:00
|
|
|
|
2013-06-17 14:56:26 -04:00
|
|
|
// Configure is responsible for setting up configuration, storing
|
|
|
|
// the state for later, and returning and errors, such as validation
|
|
|
|
// errors.
|
2013-07-01 17:59:23 -04:00
|
|
|
Configure(...interface{}) error
|
2013-06-17 14:56:26 -04:00
|
|
|
|
|
|
|
// PostProcess takes a previously created Artifact and produces another
|
2019-04-29 07:06:09 -04:00
|
|
|
// Artifact. If an error occurs, it should return that error. If `keep` is
|
|
|
|
// true, then the previous artifact defaults to being kept if user has not
|
|
|
|
// given a value to keep_input_artifact. If forceOverride is true, then any
|
|
|
|
// user input for keep_input_artifact is ignored and the artifact is either
|
|
|
|
// kept or discarded according to the value set in `keep`.
|
2019-04-08 13:59:42 -04:00
|
|
|
// PostProcess is cancellable using context
|
2020-12-01 17:48:55 -05:00
|
|
|
PostProcess(context.Context, Ui, Artifact) (a Artifact, keep bool, forceOverride bool, err error)
|
2013-06-17 14:56:26 -04:00
|
|
|
}
|