2013-05-10 19:59:28 -04:00
|
|
|
package packer
|
|
|
|
|
|
|
|
// Implementers of Builder are responsible for actually building images
|
|
|
|
// on some platform given some configuration.
|
|
|
|
type Builder interface {
|
2013-06-03 17:44:34 -04:00
|
|
|
// Prepare is responsible for reading in some configuration, in the raw form
|
|
|
|
// of map[string]interface{}, and storing that state for use later. Any setup
|
|
|
|
// should be done in this method. Note that NO side effects should really take
|
|
|
|
// place in prepare. It is meant as a state setup step only.
|
2013-05-10 19:59:28 -04:00
|
|
|
Prepare(config interface{}) error
|
2013-06-03 17:44:34 -04:00
|
|
|
|
|
|
|
// Run is where the actual build should take place. It takes a Build and a Ui.
|
2013-05-22 01:10:21 -04:00
|
|
|
Run(ui Ui, hook Hook) Artifact
|
2013-06-03 17:44:34 -04:00
|
|
|
|
|
|
|
// Cancel cancels a possibly running Builder. This should block until
|
|
|
|
// the builder actually cancels and cleans up after itself.
|
|
|
|
Cancel()
|
2013-05-10 19:59:28 -04:00
|
|
|
}
|