builder/*: convert to common StepProvision
This commit is contained in:
parent
f170c6f564
commit
8e1e40c096
|
@ -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{},
|
||||||
}
|
}
|
||||||
|
|
|
@ -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{}) {}
|
|
|
@ -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),
|
||||||
}
|
}
|
||||||
|
|
|
@ -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{}) {}
|
|
|
@ -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),
|
||||||
}
|
}
|
||||||
|
|
|
@ -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{}) {}
|
|
|
@ -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{},
|
||||||
|
|
|
@ -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{}) {}
|
|
Loading…
Reference in New Issue