diff --git a/builder/amazonebs/builder.go b/builder/amazonebs/builder.go index 227514836..da3dbf3f0 100644 --- a/builder/amazonebs/builder.go +++ b/builder/amazonebs/builder.go @@ -16,11 +16,18 @@ import ( ) type config struct { + // Access information AccessKey string `mapstructure:"access_key"` - AMIName string `mapstructure:"ami_name"` - Region string SecretKey string `mapstructure:"secret_key"` - SourceAmi string `mapstructure:"source_ami"` + + // Information for the source AMI + Region string + SourceAmi string `mapstructure:"source_ami"` + SSHUsername string `mapstructure:"ssh_username"` + SSHKeyPath string `mapstructure:"ssh_private_key_path"` + + // Configuration of the resulting AMI + AMIName string `mapstructure:"ami_name"` } type Builder struct { diff --git a/command/build/command.go b/command/build/command.go index 8d4b441b9..c37933c77 100644 --- a/command/build/command.go +++ b/command/build/command.go @@ -34,7 +34,7 @@ func (Command) Run(env packer.Environment, args []string) int { // The component finder for our builds components := &packer.ComponentFinder{ Builder: env.Builder, - Hook: env.Hook, + Hook: env.Hook, } // Go through each builder and compile the builds that we care about diff --git a/communicator/ssh/communicator_test.go b/communicator/ssh/communicator_test.go index 5dd424bab..e83d3d571 100644 --- a/communicator/ssh/communicator_test.go +++ b/communicator/ssh/communicator_test.go @@ -3,8 +3,8 @@ package ssh import ( "bytes" "code.google.com/p/go.crypto/ssh" - "github.com/mitchellh/packer/packer" "fmt" + "github.com/mitchellh/packer/packer" "net" "strings" "testing" diff --git a/packer/communicator.go b/packer/communicator.go index 54df5b34b..e57c8ec38 100644 --- a/packer/communicator.go +++ b/packer/communicator.go @@ -29,10 +29,10 @@ type Communicator interface { // ExitStatus is the exit code of the remote process. It is only available // once Wait is called. type RemoteCommand struct { - Stdin io.Writer - Stdout io.Reader - Stderr io.Reader - Exited bool + Stdin io.Writer + Stdout io.Reader + Stderr io.Reader + Exited bool ExitStatus int } diff --git a/packer/environment.go b/packer/environment.go index 287c89b41..bbf02e764 100644 --- a/packer/environment.go +++ b/packer/environment.go @@ -43,16 +43,16 @@ type Environment interface { // An implementation of an Environment that represents the Packer core // environment. type coreEnvironment struct { - commands []string - components ComponentFinder - ui Ui + commands []string + components ComponentFinder + ui Ui } // This struct configures new environments. type EnvironmentConfig struct { - Commands []string - Components ComponentFinder - Ui Ui + Commands []string + Components ComponentFinder + Ui Ui } // DefaultEnvironmentConfig returns a default EnvironmentConfig that can diff --git a/packer/hook_test.go b/packer/hook_test.go index 550568e25..62ebbdac3 100644 --- a/packer/hook_test.go +++ b/packer/hook_test.go @@ -7,10 +7,10 @@ import ( type TestHook struct { runCalled bool - runComm Communicator - runData interface{} - runName string - runUi Ui + runComm Communicator + runData interface{} + runName string + runUi Ui } func (t *TestHook) Run(name string, ui Ui, comm Communicator, data interface{}) { diff --git a/packer/plugin/hook.go b/packer/plugin/hook.go index 8bc1c2ed5..9c4e09836 100644 --- a/packer/plugin/hook.go +++ b/packer/plugin/hook.go @@ -9,8 +9,8 @@ import ( ) type cmdHook struct { - hook packer.Hook - client *client + hook packer.Hook + client *client } func (c *cmdHook) Run(name string, ui packer.Ui, comm packer.Communicator, data interface{}) { diff --git a/packer/rpc/communicator.go b/packer/rpc/communicator.go index df3765ff3..48d623ce2 100644 --- a/packer/rpc/communicator.go +++ b/packer/rpc/communicator.go @@ -28,19 +28,19 @@ type RemoteCommandServer struct { } type CommunicatorStartResponse struct { - StdinAddress string - StdoutAddress string - StderrAddress string + StdinAddress string + StdoutAddress string + StderrAddress string RemoteCommandAddress string } type CommunicatorDownloadArgs struct { - Path string + Path string WriterAddress string } type CommunicatorUploadArgs struct { - Path string + Path string ReaderAddress string } diff --git a/packer/rpc/communicator_test.go b/packer/rpc/communicator_test.go index a1b066cda..5026e0c44 100644 --- a/packer/rpc/communicator_test.go +++ b/packer/rpc/communicator_test.go @@ -11,20 +11,20 @@ import ( type testCommunicator struct { startCalled bool - startCmd string + startCmd string - startIn *io.PipeReader - startOut *io.PipeWriter - startErr *io.PipeWriter - startExited *bool + startIn *io.PipeReader + startOut *io.PipeWriter + startErr *io.PipeWriter + startExited *bool startExitStatus *int uploadCalled bool - uploadPath string - uploadData string + uploadPath string + uploadData string downloadCalled bool - downloadPath string + downloadPath string } func (t *testCommunicator) Start(cmd string) (*packer.RemoteCommand, error) { diff --git a/packer/rpc/hook.go b/packer/rpc/hook.go index d01b86cfb..c39dd1fd3 100644 --- a/packer/rpc/hook.go +++ b/packer/rpc/hook.go @@ -18,8 +18,8 @@ type HookServer struct { } type HookRunArgs struct { - Name string - Data interface{} + Name string + Data interface{} RPCAddress string } diff --git a/packer/rpc/hook_test.go b/packer/rpc/hook_test.go index 66b16b5d9..8e94e5a0f 100644 --- a/packer/rpc/hook_test.go +++ b/packer/rpc/hook_test.go @@ -8,8 +8,8 @@ import ( ) type testHook struct { - runCalled bool - runUi packer.Ui + runCalled bool + runUi packer.Ui } func (h *testHook) Run(name string, ui packer.Ui, comm packer.Communicator, data interface{}) {