Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
15f215d0
Commit
15f215d0
authored
May 20, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go fmt
parent
2efab467
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
45 additions
and
38 deletions
+45
-38
builder/amazonebs/builder.go
builder/amazonebs/builder.go
+10
-3
command/build/command.go
command/build/command.go
+1
-1
communicator/ssh/communicator_test.go
communicator/ssh/communicator_test.go
+1
-1
packer/communicator.go
packer/communicator.go
+4
-4
packer/environment.go
packer/environment.go
+6
-6
packer/hook_test.go
packer/hook_test.go
+4
-4
packer/plugin/hook.go
packer/plugin/hook.go
+2
-2
packer/rpc/communicator.go
packer/rpc/communicator.go
+5
-5
packer/rpc/communicator_test.go
packer/rpc/communicator_test.go
+8
-8
packer/rpc/hook.go
packer/rpc/hook.go
+2
-2
packer/rpc/hook_test.go
packer/rpc/hook_test.go
+2
-2
No files found.
builder/amazonebs/builder.go
View file @
15f215d0
...
@@ -16,11 +16,18 @@ import (
...
@@ -16,11 +16,18 @@ import (
)
)
type
config
struct
{
type
config
struct
{
// Access information
AccessKey
string
`mapstructure:"access_key"`
AccessKey
string
`mapstructure:"access_key"`
AMIName
string
`mapstructure:"ami_name"`
Region
string
SecretKey
string
`mapstructure:"secret_key"`
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
{
type
Builder
struct
{
...
...
command/build/command.go
View file @
15f215d0
...
@@ -34,7 +34,7 @@ func (Command) Run(env packer.Environment, args []string) int {
...
@@ -34,7 +34,7 @@ func (Command) Run(env packer.Environment, args []string) int {
// The component finder for our builds
// The component finder for our builds
components
:=
&
packer
.
ComponentFinder
{
components
:=
&
packer
.
ComponentFinder
{
Builder
:
env
.
Builder
,
Builder
:
env
.
Builder
,
Hook
:
env
.
Hook
,
Hook
:
env
.
Hook
,
}
}
// Go through each builder and compile the builds that we care about
// Go through each builder and compile the builds that we care about
...
...
communicator/ssh/communicator_test.go
View file @
15f215d0
...
@@ -3,8 +3,8 @@ package ssh
...
@@ -3,8 +3,8 @@ package ssh
import
(
import
(
"bytes"
"bytes"
"code.google.com/p/go.crypto/ssh"
"code.google.com/p/go.crypto/ssh"
"github.com/mitchellh/packer/packer"
"fmt"
"fmt"
"github.com/mitchellh/packer/packer"
"net"
"net"
"strings"
"strings"
"testing"
"testing"
...
...
packer/communicator.go
View file @
15f215d0
...
@@ -29,10 +29,10 @@ type Communicator interface {
...
@@ -29,10 +29,10 @@ type Communicator interface {
// ExitStatus is the exit code of the remote process. It is only available
// ExitStatus is the exit code of the remote process. It is only available
// once Wait is called.
// once Wait is called.
type
RemoteCommand
struct
{
type
RemoteCommand
struct
{
Stdin
io
.
Writer
Stdin
io
.
Writer
Stdout
io
.
Reader
Stdout
io
.
Reader
Stderr
io
.
Reader
Stderr
io
.
Reader
Exited
bool
Exited
bool
ExitStatus
int
ExitStatus
int
}
}
...
...
packer/environment.go
View file @
15f215d0
...
@@ -43,16 +43,16 @@ type Environment interface {
...
@@ -43,16 +43,16 @@ type Environment interface {
// An implementation of an Environment that represents the Packer core
// An implementation of an Environment that represents the Packer core
// environment.
// environment.
type
coreEnvironment
struct
{
type
coreEnvironment
struct
{
commands
[]
string
commands
[]
string
components
ComponentFinder
components
ComponentFinder
ui
Ui
ui
Ui
}
}
// This struct configures new environments.
// This struct configures new environments.
type
EnvironmentConfig
struct
{
type
EnvironmentConfig
struct
{
Commands
[]
string
Commands
[]
string
Components
ComponentFinder
Components
ComponentFinder
Ui
Ui
Ui
Ui
}
}
// DefaultEnvironmentConfig returns a default EnvironmentConfig that can
// DefaultEnvironmentConfig returns a default EnvironmentConfig that can
...
...
packer/hook_test.go
View file @
15f215d0
...
@@ -7,10 +7,10 @@ import (
...
@@ -7,10 +7,10 @@ import (
type
TestHook
struct
{
type
TestHook
struct
{
runCalled
bool
runCalled
bool
runComm
Communicator
runComm
Communicator
runData
interface
{}
runData
interface
{}
runName
string
runName
string
runUi
Ui
runUi
Ui
}
}
func
(
t
*
TestHook
)
Run
(
name
string
,
ui
Ui
,
comm
Communicator
,
data
interface
{})
{
func
(
t
*
TestHook
)
Run
(
name
string
,
ui
Ui
,
comm
Communicator
,
data
interface
{})
{
...
...
packer/plugin/hook.go
View file @
15f215d0
...
@@ -9,8 +9,8 @@ import (
...
@@ -9,8 +9,8 @@ import (
)
)
type
cmdHook
struct
{
type
cmdHook
struct
{
hook
packer
.
Hook
hook
packer
.
Hook
client
*
client
client
*
client
}
}
func
(
c
*
cmdHook
)
Run
(
name
string
,
ui
packer
.
Ui
,
comm
packer
.
Communicator
,
data
interface
{})
{
func
(
c
*
cmdHook
)
Run
(
name
string
,
ui
packer
.
Ui
,
comm
packer
.
Communicator
,
data
interface
{})
{
...
...
packer/rpc/communicator.go
View file @
15f215d0
...
@@ -28,19 +28,19 @@ type RemoteCommandServer struct {
...
@@ -28,19 +28,19 @@ type RemoteCommandServer struct {
}
}
type
CommunicatorStartResponse
struct
{
type
CommunicatorStartResponse
struct
{
StdinAddress
string
StdinAddress
string
StdoutAddress
string
StdoutAddress
string
StderrAddress
string
StderrAddress
string
RemoteCommandAddress
string
RemoteCommandAddress
string
}
}
type
CommunicatorDownloadArgs
struct
{
type
CommunicatorDownloadArgs
struct
{
Path
string
Path
string
WriterAddress
string
WriterAddress
string
}
}
type
CommunicatorUploadArgs
struct
{
type
CommunicatorUploadArgs
struct
{
Path
string
Path
string
ReaderAddress
string
ReaderAddress
string
}
}
...
...
packer/rpc/communicator_test.go
View file @
15f215d0
...
@@ -11,20 +11,20 @@ import (
...
@@ -11,20 +11,20 @@ import (
type
testCommunicator
struct
{
type
testCommunicator
struct
{
startCalled
bool
startCalled
bool
startCmd
string
startCmd
string
startIn
*
io
.
PipeReader
startIn
*
io
.
PipeReader
startOut
*
io
.
PipeWriter
startOut
*
io
.
PipeWriter
startErr
*
io
.
PipeWriter
startErr
*
io
.
PipeWriter
startExited
*
bool
startExited
*
bool
startExitStatus
*
int
startExitStatus
*
int
uploadCalled
bool
uploadCalled
bool
uploadPath
string
uploadPath
string
uploadData
string
uploadData
string
downloadCalled
bool
downloadCalled
bool
downloadPath
string
downloadPath
string
}
}
func
(
t
*
testCommunicator
)
Start
(
cmd
string
)
(
*
packer
.
RemoteCommand
,
error
)
{
func
(
t
*
testCommunicator
)
Start
(
cmd
string
)
(
*
packer
.
RemoteCommand
,
error
)
{
...
...
packer/rpc/hook.go
View file @
15f215d0
...
@@ -18,8 +18,8 @@ type HookServer struct {
...
@@ -18,8 +18,8 @@ type HookServer struct {
}
}
type
HookRunArgs
struct
{
type
HookRunArgs
struct
{
Name
string
Name
string
Data
interface
{}
Data
interface
{}
RPCAddress
string
RPCAddress
string
}
}
...
...
packer/rpc/hook_test.go
View file @
15f215d0
...
@@ -8,8 +8,8 @@ import (
...
@@ -8,8 +8,8 @@ import (
)
)
type
testHook
struct
{
type
testHook
struct
{
runCalled
bool
runCalled
bool
runUi
packer
.
Ui
runUi
packer
.
Ui
}
}
func
(
h
*
testHook
)
Run
(
name
string
,
ui
packer
.
Ui
,
comm
packer
.
Communicator
,
data
interface
{})
{
func
(
h
*
testHook
)
Run
(
name
string
,
ui
packer
.
Ui
,
comm
packer
.
Communicator
,
data
interface
{})
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment