builder/amazon/instance: boilerplate for bundle volume

This commit is contained in:
Mitchell Hashimoto 2013-07-21 11:32:59 -07:00
parent c39299c21f
commit b11b60746b
3 changed files with 18 additions and 0 deletions

View File

@ -111,6 +111,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
},
&common.StepProvision{},
&StepUploadX509Cert{},
&StepBundleVolume{},
}
// Run!

View File

@ -0,0 +1,15 @@
package instance
import (
"github.com/mitchellh/multistep"
"time"
)
type StepBundleVolume struct{}
func (s *StepBundleVolume) Run(state map[string]interface{}) multistep.StepAction {
time.Sleep(10 * time.Hour)
return multistep.ActionContinue
}
func (s *StepBundleVolume) Cleanup(map[string]interface{}) {}

View File

@ -20,11 +20,13 @@ func (s *StepUploadX509Cert) Run(state map[string]interface{}) multistep.StepAct
ui.Say("Uploading X509 Certificate...")
if err := s.uploadSingle(comm, x509RemoteCertPath, config.X509CertPath); err != nil {
state["error"] = fmt.Errorf("Error uploading X509 cert: %s", err)
ui.Error(state["error"].(error).Error())
return multistep.ActionHalt
}
if err := s.uploadSingle(comm, x509RemoteKeyPath, config.X509KeyPath); err != nil {
state["error"] = fmt.Errorf("Error uploading X509 cert: %s", err)
ui.Error(state["error"].(error).Error())
return multistep.ActionHalt
}