2013-06-13 13:56:34 -04:00
|
|
|
package digitalocean
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/mitchellh/multistep"
|
|
|
|
"github.com/mitchellh/packer/packer"
|
|
|
|
"log"
|
|
|
|
)
|
|
|
|
|
|
|
|
type stepProvision struct{}
|
|
|
|
|
|
|
|
func (*stepProvision) Run(state map[string]interface{}) multistep.StepAction {
|
|
|
|
comm := state["communicator"].(packer.Communicator)
|
|
|
|
hook := state["hook"].(packer.Hook)
|
|
|
|
ui := state["ui"].(packer.Ui)
|
|
|
|
|
|
|
|
log.Println("Running the provision hook")
|
2013-06-26 20:54:57 -04:00
|
|
|
if err := hook.Run(packer.HookProvision, ui, comm, nil); err != nil {
|
|
|
|
state["error"] = err
|
|
|
|
return multistep.ActionHalt
|
|
|
|
}
|
2013-06-13 13:56:34 -04:00
|
|
|
|
|
|
|
return multistep.ActionContinue
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*stepProvision) Cleanup(map[string]interface{}) {}
|