builder/amazon/instance: boilerplate for bundle volume
This commit is contained in:
parent
2674bdc96d
commit
f94500b324
|
@ -111,6 +111,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&common.StepProvision{},
|
||||||
&StepUploadX509Cert{},
|
&StepUploadX509Cert{},
|
||||||
|
&StepBundleVolume{},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run!
|
// Run!
|
||||||
|
|
|
@ -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{}) {}
|
|
@ -20,11 +20,13 @@ func (s *StepUploadX509Cert) Run(state map[string]interface{}) multistep.StepAct
|
||||||
ui.Say("Uploading X509 Certificate...")
|
ui.Say("Uploading X509 Certificate...")
|
||||||
if err := s.uploadSingle(comm, x509RemoteCertPath, config.X509CertPath); err != nil {
|
if err := s.uploadSingle(comm, x509RemoteCertPath, config.X509CertPath); err != nil {
|
||||||
state["error"] = fmt.Errorf("Error uploading X509 cert: %s", err)
|
state["error"] = fmt.Errorf("Error uploading X509 cert: %s", err)
|
||||||
|
ui.Error(state["error"].(error).Error())
|
||||||
return multistep.ActionHalt
|
return multistep.ActionHalt
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := s.uploadSingle(comm, x509RemoteKeyPath, config.X509KeyPath); err != nil {
|
if err := s.uploadSingle(comm, x509RemoteKeyPath, config.X509KeyPath); err != nil {
|
||||||
state["error"] = fmt.Errorf("Error uploading X509 cert: %s", err)
|
state["error"] = fmt.Errorf("Error uploading X509 cert: %s", err)
|
||||||
|
ui.Error(state["error"].(error).Error())
|
||||||
return multistep.ActionHalt
|
return multistep.ActionHalt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue