builder/*: convert to common StepProvision

This commit is contained in:
Mitchell Hashimoto 2013-07-16 15:44:41 +09:00
parent f170c6f564
commit 8e1e40c096
8 changed files with 4 additions and 104 deletions

View File

@ -164,7 +164,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
SSHConfig: sshConfig, SSHConfig: sshConfig,
SSHWaitTimeout: b.config.sshTimeout, SSHWaitTimeout: b.config.sshTimeout,
}, },
&stepProvision{}, &common.StepProvision{},
&stepStopInstance{}, &stepStopInstance{},
&stepCreateAMI{}, &stepCreateAMI{},
} }

View File

@ -1,25 +0,0 @@
package ebs
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")
if err := hook.Run(packer.HookProvision, ui, comm, nil); err != nil {
state["error"] = err
return multistep.ActionHalt
}
return multistep.ActionContinue
}
func (*stepProvision) Cleanup(map[string]interface{}) {}

View File

@ -221,7 +221,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
SSHConfig: sshConfig, SSHConfig: sshConfig,
SSHWaitTimeout: 5 * time.Minute, SSHWaitTimeout: 5 * time.Minute,
}, },
new(stepProvision), new(common.StepProvision),
new(stepPowerOff), new(stepPowerOff),
new(stepSnapshot), new(stepSnapshot),
} }

View File

@ -1,25 +0,0 @@
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")
if err := hook.Run(packer.HookProvision, ui, comm, nil); err != nil {
state["error"] = err
return multistep.ActionHalt
}
return multistep.ActionContinue
}
func (*stepProvision) Cleanup(map[string]interface{}) {}

View File

@ -330,7 +330,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
}, },
new(stepUploadVersion), new(stepUploadVersion),
new(stepUploadGuestAdditions), new(stepUploadGuestAdditions),
new(stepProvision), new(common.StepProvision),
new(stepShutdown), new(stepShutdown),
new(stepExport), new(stepExport),
} }

View File

@ -1,25 +0,0 @@
package virtualbox
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")
if err := hook.Run(packer.HookProvision, ui, comm, nil); err != nil {
state["error"] = err
return multistep.ActionHalt
}
return multistep.ActionContinue
}
func (*stepProvision) Cleanup(map[string]interface{}) {}

View File

@ -290,7 +290,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
SSHWaitTimeout: b.config.sshWaitTimeout, SSHWaitTimeout: b.config.sshWaitTimeout,
}, },
&stepUploadTools{}, &stepUploadTools{},
&stepProvision{}, &common.StepProvision{},
&stepShutdown{}, &stepShutdown{},
&stepCleanFiles{}, &stepCleanFiles{},
&stepCleanVMX{}, &stepCleanVMX{},

View File

@ -1,25 +0,0 @@
package vmware
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")
if err := hook.Run(packer.HookProvision, ui, comm, nil); err != nil {
state["error"] = err
return multistep.ActionHalt
}
return multistep.ActionContinue
}
func (*stepProvision) Cleanup(map[string]interface{}) {}