Commit dd89716e authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer: An initial PostProcessor interface

parent 8f097399
package packer
// 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 {
// Configure is responsible for setting up configuration, storing
// the state for later, and returning and errors, such as validation
// errors.
Configure(interface{}) error
// PostProcess takes a previously created Artifact and produces another
// Artifact. If an error occurs, it should return that error.
PostProcess(Artifact) (Artifact, error)
}
...@@ -14,7 +14,7 @@ type rawTemplate struct { ...@@ -14,7 +14,7 @@ type rawTemplate struct {
Builders []map[string]interface{} Builders []map[string]interface{}
Hooks map[string][]string Hooks map[string][]string
Provisioners []map[string]interface{} Provisioners []map[string]interface{}
Outputs []map[string]interface{} PostProcessors []map[string]interface{} `json:"post-processors"`
} }
// The Template struct represents a parsed template, parsed into the most // The Template struct represents a parsed template, parsed into the most
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment