2013-06-18 12:49:05 -04:00
|
|
|
package packer
|
|
|
|
|
2013-06-18 13:31:52 -04:00
|
|
|
type TestPostProcessor struct {
|
2013-06-19 01:45:53 -04:00
|
|
|
artifactId string
|
2013-07-01 14:30:39 -04:00
|
|
|
keep bool
|
2013-06-18 13:31:52 -04:00
|
|
|
configCalled bool
|
|
|
|
configVal interface{}
|
|
|
|
ppCalled bool
|
|
|
|
ppArtifact Artifact
|
2013-06-19 00:54:33 -04:00
|
|
|
ppUi Ui
|
2013-06-18 13:31:52 -04:00
|
|
|
}
|
2013-06-18 12:49:05 -04:00
|
|
|
|
2013-06-18 13:31:52 -04:00
|
|
|
func (pp *TestPostProcessor) Configure(v interface{}) error {
|
|
|
|
pp.configCalled = true
|
|
|
|
pp.configVal = v
|
2013-06-18 12:49:05 -04:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2013-07-01 14:30:39 -04:00
|
|
|
func (pp *TestPostProcessor) PostProcess(ui Ui, a Artifact) (Artifact, bool, error) {
|
2013-06-18 13:31:52 -04:00
|
|
|
pp.ppCalled = true
|
|
|
|
pp.ppArtifact = a
|
2013-06-18 23:38:21 -04:00
|
|
|
pp.ppUi = ui
|
2013-07-01 14:30:39 -04:00
|
|
|
return &TestArtifact{id: pp.artifactId}, pp.keep, nil
|
2013-06-18 12:49:05 -04:00
|
|
|
}
|