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
99af93f8
Commit
99af93f8
authored
Jun 11, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
foundation for virtualbox builder
parent
13364820
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
0 deletions
+62
-0
builder/virtualbox/builder.go
builder/virtualbox/builder.go
+33
-0
builder/virtualbox/builder_test.go
builder/virtualbox/builder_test.go
+18
-0
config.go
config.go
+1
-0
plugin/builder-virtualbox/main.go
plugin/builder-virtualbox/main.go
+10
-0
No files found.
builder/virtualbox/builder.go
0 → 100644
View file @
99af93f8
package
virtualbox
import
(
"github.com/mitchellh/mapstructure"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
)
const
BuilderId
=
"mitchellh.virtualbox"
type
Builder
struct
{
config
config
runner
multistep
.
Runner
}
type
config
struct
{
OutputDir
string
`mapstructure:"output_directory"`
}
func
(
b
*
Builder
)
Prepare
(
raw
interface
{})
error
{
if
err
:=
mapstructure
.
Decode
(
raw
,
&
b
.
config
);
err
!=
nil
{
return
err
}
return
nil
}
func
(
b
*
Builder
)
Run
(
ui
packer
.
Ui
,
hook
packer
.
Hook
,
cache
packer
.
Cache
)
packer
.
Artifact
{
return
nil
}
func
(
b
*
Builder
)
Cancel
()
{
}
builder/virtualbox/builder_test.go
0 → 100644
View file @
99af93f8
package
virtualbox
import
(
"github.com/mitchellh/packer/packer"
"testing"
)
func
testConfig
()
map
[
string
]
interface
{}
{
return
map
[
string
]
interface
{}{}
}
func
TestBuilder_ImplementsBuilder
(
t
*
testing
.
T
)
{
var
raw
interface
{}
raw
=
&
Builder
{}
if
_
,
ok
:=
raw
.
(
packer
.
Builder
);
!
ok
{
t
.
Error
(
"Builder must implement builder."
)
}
}
config.go
View file @
99af93f8
...
...
@@ -18,6 +18,7 @@ const defaultConfig = `
"builders": {
"amazon-ebs": "packer-builder-amazon-ebs",
"virtualbox": "packer-builder-virtualbox",
"vmware": "packer-builder-vmware"
},
...
...
plugin/builder-virtualbox/main.go
0 → 100644
View file @
99af93f8
package
main
import
(
"github.com/mitchellh/packer/builder/virtualbox"
"github.com/mitchellh/packer/packer/plugin"
)
func
main
()
{
plugin
.
ServeBuilder
(
new
(
virtualbox
.
Builder
))
}
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