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
d62edd6c
Commit
d62edd6c
authored
Jul 24, 2014
by
abishopric
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print the evaluated bundle commands
parent
b30f901f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
4 deletions
+24
-4
builder/amazon/instance/builder.go
builder/amazon/instance/builder.go
+6
-2
builder/amazon/instance/step_bundle_volume.go
builder/amazon/instance/step_bundle_volume.go
+9
-1
builder/amazon/instance/step_upload_bundle.go
builder/amazon/instance/step_upload_bundle.go
+9
-1
No files found.
builder/amazon/instance/builder.go
View file @
d62edd6c
...
@@ -223,8 +223,12 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
...
@@ -223,8 +223,12 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
},
},
&
common
.
StepProvision
{},
&
common
.
StepProvision
{},
&
StepUploadX509Cert
{},
&
StepUploadX509Cert
{},
&
StepBundleVolume
{},
&
StepBundleVolume
{
&
StepUploadBundle
{},
Debug
:
b
.
config
.
PackerDebug
,
},
&
StepUploadBundle
{
Debug
:
b
.
config
.
PackerDebug
,
},
&
StepRegisterAMI
{},
&
StepRegisterAMI
{},
&
awscommon
.
StepAMIRegionCopy
{
&
awscommon
.
StepAMIRegionCopy
{
Regions
:
b
.
config
.
AMIRegions
,
Regions
:
b
.
config
.
AMIRegions
,
...
...
builder/amazon/instance/step_bundle_volume.go
View file @
d62edd6c
...
@@ -2,6 +2,7 @@ package instance
...
@@ -2,6 +2,7 @@ package instance
import
(
import
(
"fmt"
"fmt"
"github.com/mitchellh/goamz/ec2"
"github.com/mitchellh/goamz/ec2"
"github.com/mitchellh/multistep"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/packer"
...
@@ -17,7 +18,9 @@ type bundleCmdData struct {
...
@@ -17,7 +18,9 @@ type bundleCmdData struct {
PrivatePath
string
PrivatePath
string
}
}
type
StepBundleVolume
struct
{}
type
StepBundleVolume
struct
{
Debug
bool
}
func
(
s
*
StepBundleVolume
)
Run
(
state
multistep
.
StateBag
)
multistep
.
StepAction
{
func
(
s
*
StepBundleVolume
)
Run
(
state
multistep
.
StateBag
)
multistep
.
StepAction
{
comm
:=
state
.
Get
(
"communicator"
)
.
(
packer
.
Communicator
)
comm
:=
state
.
Get
(
"communicator"
)
.
(
packer
.
Communicator
)
...
@@ -48,6 +51,11 @@ func (s *StepBundleVolume) Run(state multistep.StateBag) multistep.StepAction {
...
@@ -48,6 +51,11 @@ func (s *StepBundleVolume) Run(state multistep.StateBag) multistep.StepAction {
ui
.
Say
(
"Bundling the volume..."
)
ui
.
Say
(
"Bundling the volume..."
)
cmd
:=
new
(
packer
.
RemoteCmd
)
cmd
:=
new
(
packer
.
RemoteCmd
)
cmd
.
Command
=
config
.
BundleVolCommand
cmd
.
Command
=
config
.
BundleVolCommand
if
s
.
Debug
{
ui
.
Say
(
fmt
.
Sprintf
(
"Running: %s"
,
config
.
BundleVolCommand
))
}
if
err
:=
cmd
.
StartWithUi
(
comm
,
ui
);
err
!=
nil
{
if
err
:=
cmd
.
StartWithUi
(
comm
,
ui
);
err
!=
nil
{
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Error bundling volume: %s"
,
err
))
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Error bundling volume: %s"
,
err
))
ui
.
Error
(
state
.
Get
(
"error"
)
.
(
error
)
.
Error
())
ui
.
Error
(
state
.
Get
(
"error"
)
.
(
error
)
.
Error
())
...
...
builder/amazon/instance/step_upload_bundle.go
View file @
d62edd6c
...
@@ -2,6 +2,7 @@ package instance
...
@@ -2,6 +2,7 @@ package instance
import
(
import
(
"fmt"
"fmt"
"github.com/mitchellh/multistep"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/packer"
)
)
...
@@ -15,7 +16,9 @@ type uploadCmdData struct {
...
@@ -15,7 +16,9 @@ type uploadCmdData struct {
SecretKey
string
SecretKey
string
}
}
type
StepUploadBundle
struct
{}
type
StepUploadBundle
struct
{
Debug
bool
}
func
(
s
*
StepUploadBundle
)
Run
(
state
multistep
.
StateBag
)
multistep
.
StepAction
{
func
(
s
*
StepUploadBundle
)
Run
(
state
multistep
.
StateBag
)
multistep
.
StepAction
{
comm
:=
state
.
Get
(
"communicator"
)
.
(
packer
.
Communicator
)
comm
:=
state
.
Get
(
"communicator"
)
.
(
packer
.
Communicator
)
...
@@ -49,6 +52,11 @@ func (s *StepUploadBundle) Run(state multistep.StateBag) multistep.StepAction {
...
@@ -49,6 +52,11 @@ func (s *StepUploadBundle) Run(state multistep.StateBag) multistep.StepAction {
ui
.
Say
(
"Uploading the bundle..."
)
ui
.
Say
(
"Uploading the bundle..."
)
cmd
:=
&
packer
.
RemoteCmd
{
Command
:
config
.
BundleUploadCommand
}
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
{
if
err
:=
cmd
.
StartWithUi
(
comm
,
ui
);
err
!=
nil
{
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Error uploading volume: %s"
,
err
))
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Error uploading volume: %s"
,
err
))
ui
.
Error
(
state
.
Get
(
"error"
)
.
(
error
)
.
Error
())
ui
.
Error
(
state
.
Get
(
"error"
)
.
(
error
)
.
Error
())
...
...
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