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
553800b3
Commit
553800b3
authored
Jul 05, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
post-processor/vagrant: provider PPs get properly configured
parent
1a2e4f9d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
6 deletions
+15
-6
CHANGELOG.md
CHANGELOG.md
+2
-0
post-processor/vagrant/aws.go
post-processor/vagrant/aws.go
+1
-0
post-processor/vagrant/post-processor.go
post-processor/vagrant/post-processor.go
+11
-5
post-processor/vagrant/util.go
post-processor/vagrant/util.go
+1
-1
No files found.
CHANGELOG.md
View file @
553800b3
...
...
@@ -12,6 +12,8 @@ IMPROVEMENTS:
BUG FIXES:
*
vagrant: The
`BuildName`
template propery works properly in
the output path.
*
vagrant: Properly configure the provider-specific post-processors so
things like
`vagrantfile_template`
work. [GH-129]
...
...
post-processor/vagrant/aws.go
View file @
553800b3
...
...
@@ -105,6 +105,7 @@ func (p *AWSBoxPostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact
// Compress the directory to the given output path
if
err
:=
DirToBox
(
outputPath
,
dir
);
err
!=
nil
{
err
=
fmt
.
Errorf
(
"error creating box: %s"
,
err
)
return
nil
,
false
,
err
}
...
...
post-processor/vagrant/post-processor.go
View file @
553800b3
...
...
@@ -40,8 +40,10 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
}
}
ppExtraConfig
:=
make
(
map
[
string
]
interface
{})
if
p
.
config
.
OutputPath
==
""
{
p
.
config
.
OutputPath
=
"packer_{{ .BuildName }}_{{.Provider}}.box"
ppExtraConfig
[
"output"
]
=
p
.
config
.
OutputPath
}
_
,
err
:=
template
.
New
(
"output"
)
.
Parse
(
p
.
config
.
OutputPath
)
...
...
@@ -49,16 +51,15 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
return
fmt
.
Errorf
(
"output invalid template: %s"
,
err
)
}
// Store the extra configuration for post-processors
p
.
rawConfigs
=
append
(
p
.
rawConfigs
,
ppExtraConfig
)
// TODO(mitchellh): Properly handle multiple raw configs
var
mapConfig
map
[
string
]
interface
{}
if
err
:=
mapstructure
.
Decode
(
raws
[
0
],
&
mapConfig
);
err
!=
nil
{
return
err
}
packerConfig
:=
map
[
string
]
interface
{}{
packer
.
BuildNameConfigKey
:
p
.
config
.
PackerBuildName
,
}
p
.
premade
=
make
(
map
[
string
]
packer
.
PostProcessor
)
errors
:=
make
([]
error
,
0
)
for
k
,
raw
:=
range
mapConfig
{
...
...
@@ -67,7 +68,12 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
continue
}
if
err
:=
pp
.
Configure
(
raw
,
packerConfig
);
err
!=
nil
{
// Create the proper list of configurations
ppConfigs
:=
make
([]
interface
{},
0
,
len
(
p
.
rawConfigs
)
+
1
)
copy
(
ppConfigs
,
p
.
rawConfigs
)
ppConfigs
=
append
(
ppConfigs
,
raw
)
if
err
:=
pp
.
Configure
(
ppConfigs
...
);
err
!=
nil
{
errors
=
append
(
errors
,
err
)
}
...
...
post-processor/vagrant/util.go
View file @
553800b3
...
...
@@ -25,7 +25,7 @@ type OutputPathTemplate struct {
// box. This function does not perform checks to verify that dir is
// actually a proper box. This is an expected precondition.
func
DirToBox
(
dst
,
dir
string
)
error
{
log
.
Printf
(
"Turning dir into box: %s
"
,
dir
)
log
.
Printf
(
"Turning dir into box: %s
=> %s"
,
dir
,
dst
)
dstF
,
err
:=
os
.
Create
(
dst
)
if
err
!=
nil
{
return
err
...
...
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