diff --git a/builder/amazon/instance/builder.go b/builder/amazon/instance/builder.go index 7a0920498..6df94bf62 100644 --- a/builder/amazon/instance/builder.go +++ b/builder/amazon/instance/builder.go @@ -222,8 +222,12 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe }, &common.StepProvision{}, &StepUploadX509Cert{}, - &StepBundleVolume{}, - &StepUploadBundle{}, + &StepBundleVolume{ + Debug: b.config.PackerDebug, + }, + &StepUploadBundle{ + Debug: b.config.PackerDebug, + }, &StepRegisterAMI{}, &awscommon.StepAMIRegionCopy{ Regions: b.config.AMIRegions, diff --git a/builder/amazon/instance/step_bundle_volume.go b/builder/amazon/instance/step_bundle_volume.go index 4dfbd4fc4..736e1adb2 100644 --- a/builder/amazon/instance/step_bundle_volume.go +++ b/builder/amazon/instance/step_bundle_volume.go @@ -2,6 +2,7 @@ package instance import ( "fmt" + "github.com/mitchellh/goamz/ec2" "github.com/mitchellh/multistep" "github.com/mitchellh/packer/packer" @@ -17,7 +18,9 @@ type bundleCmdData struct { PrivatePath string } -type StepBundleVolume struct{} +type StepBundleVolume struct { + Debug bool +} func (s *StepBundleVolume) Run(state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) @@ -48,6 +51,11 @@ func (s *StepBundleVolume) Run(state multistep.StateBag) multistep.StepAction { ui.Say("Bundling the volume...") cmd := new(packer.RemoteCmd) cmd.Command = config.BundleVolCommand + + if s.Debug { + ui.Say(fmt.Sprintf("Running: %s", config.BundleVolCommand)) + } + if err := cmd.StartWithUi(comm, ui); err != nil { state.Put("error", fmt.Errorf("Error bundling volume: %s", err)) ui.Error(state.Get("error").(error).Error()) diff --git a/builder/amazon/instance/step_upload_bundle.go b/builder/amazon/instance/step_upload_bundle.go index ec654aa61..dbf6a0c29 100644 --- a/builder/amazon/instance/step_upload_bundle.go +++ b/builder/amazon/instance/step_upload_bundle.go @@ -2,6 +2,7 @@ package instance import ( "fmt" + "github.com/mitchellh/multistep" "github.com/mitchellh/packer/packer" ) @@ -15,7 +16,9 @@ type uploadCmdData struct { SecretKey string } -type StepUploadBundle struct{} +type StepUploadBundle struct { + Debug bool +} func (s *StepUploadBundle) Run(state multistep.StateBag) multistep.StepAction { comm := state.Get("communicator").(packer.Communicator) @@ -49,6 +52,11 @@ func (s *StepUploadBundle) Run(state multistep.StateBag) multistep.StepAction { ui.Say("Uploading the bundle...") cmd := &packer.RemoteCmd{Command: config.BundleUploadCommand} + + if s.Debug { + ui.Say(fmt.Sprintf("Running: %s", config.BundleUploadCommand)) + } + if err := cmd.StartWithUi(comm, ui); err != nil { state.Put("error", fmt.Errorf("Error uploading volume: %s", err)) ui.Error(state.Get("error").(error).Error())