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
b11b2739
Commit
b11b2739
authored
Jun 29, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
post-processor/vagrant: rename OVF to box.ovf [GH-64]
parent
38a41867
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
CHANGELOG.md
CHANGELOG.md
+1
-0
post-processor/vagrant/virtualbox.go
post-processor/vagrant/virtualbox.go
+21
-0
No files found.
CHANGELOG.md
View file @
b11b2739
...
...
@@ -4,6 +4,7 @@ BUG FIXES:
*
amazon-ebs: Sleep between checking instance state to avoid
RequestLimitExceeded [GH-50]
*
vagrant: Rename VirtualBox ovf to "box.ovf" [GH-64]
## 0.1.1 (June 28, 2013)
...
...
post-processor/vagrant/virtualbox.go
View file @
b11b2739
...
...
@@ -111,6 +111,12 @@ func (p *VBoxBoxPostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifac
return
nil
,
err
}
// Rename the OVF file to box.ovf, as required by Vagrant
ui
.
Message
(
"Renaming the OVF to box.ovf..."
)
if
err
:=
p
.
renameOVF
(
dir
);
err
!=
nil
{
return
nil
,
err
}
// Compress the directory to the given output path
ui
.
Message
(
fmt
.
Sprintf
(
"Compressing box..."
))
if
err
:=
DirToBox
(
outputPath
,
dir
);
err
!=
nil
{
...
...
@@ -156,6 +162,21 @@ func (p *VBoxBoxPostProcessor) findBaseMacAddress(a packer.Artifact) (string, er
return
string
(
matches
[
1
]),
nil
}
func
(
p
*
VBoxBoxPostProcessor
)
renameOVF
(
dir
string
)
error
{
log
.
Println
(
"Looking for OVF to rename..."
)
matches
,
err
:=
filepath
.
Glob
(
filepath
.
Join
(
dir
,
"*.ovf"
))
if
err
!=
nil
{
return
err
}
if
len
(
matches
)
>
1
{
return
errors
.
New
(
"More than one OVF file in VirtualBox artifact."
)
}
log
.
Printf
(
"Renaming: '%s' => box.ovf"
,
matches
[
0
])
return
os
.
Rename
(
matches
[
0
],
filepath
.
Join
(
dir
,
"box.ovf"
))
}
var
defaultVBoxVagrantfile
=
`
Vagrant.configure("2") do |config|
config.vm.base_mac = "{{ .BaseMacAddress }}"
...
...
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