github.com/askholme/packer@v0.7.2-0.20140924152349-70d9566a6852/packer/post_processor.go (about)

     1  package packer
     2  
     3  // A PostProcessor is responsible for taking an artifact of a build
     4  // and doing some sort of post-processing to turn this into another
     5  // artifact. An example of a post-processor would be something that takes
     6  // the result of a build, compresses it, and returns a new artifact containing
     7  // a single file of the prior artifact compressed.
     8  type PostProcessor interface {
     9  	// Configure is responsible for setting up configuration, storing
    10  	// the state for later, and returning and errors, such as validation
    11  	// errors.
    12  	Configure(...interface{}) error
    13  
    14  	// PostProcess takes a previously created Artifact and produces another
    15  	// Artifact. If an error occurs, it should return that error. If `keep`
    16  	// is to true, then the previous artifact is forcibly kept.
    17  	PostProcess(Ui, Artifact) (a Artifact, keep bool, err error)
    18  }