packer: Put Builder definition into its own file
This commit is contained in:
parent
208daf7d03
commit
368ccab8e8
|
@ -22,20 +22,6 @@ type coreBuild struct {
|
||||||
prepareCalled bool
|
prepareCalled bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implementers of Builder are responsible for actually building images
|
|
||||||
// on some platform given some configuration.
|
|
||||||
//
|
|
||||||
// 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.
|
|
||||||
//
|
|
||||||
// Run is where the actual build should take place. It takes a Build and a Ui.
|
|
||||||
type Builder interface {
|
|
||||||
Prepare(config interface{}) error
|
|
||||||
Run(build Build, ui Ui)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns the name of the build.
|
// Returns the name of the build.
|
||||||
func (b *coreBuild) Name() string {
|
func (b *coreBuild) Name() string {
|
||||||
return b.name
|
return b.name
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package packer
|
||||||
|
|
||||||
|
// Implementers of Builder are responsible for actually building images
|
||||||
|
// on some platform given some configuration.
|
||||||
|
//
|
||||||
|
// 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.
|
||||||
|
//
|
||||||
|
// Run is where the actual build should take place. It takes a Build and a Ui.
|
||||||
|
type Builder interface {
|
||||||
|
Prepare(config interface{}) error
|
||||||
|
Run(build Build, ui Ui)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue