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