Commit 99af93f8 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

foundation for virtualbox builder

parent 13364820
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() {
}
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.")
}
}
...@@ -18,6 +18,7 @@ const defaultConfig = ` ...@@ -18,6 +18,7 @@ const defaultConfig = `
"builders": { "builders": {
"amazon-ebs": "packer-builder-amazon-ebs", "amazon-ebs": "packer-builder-amazon-ebs",
"virtualbox": "packer-builder-virtualbox",
"vmware": "packer-builder-vmware" "vmware": "packer-builder-vmware"
}, },
......
package main
import (
"github.com/mitchellh/packer/builder/virtualbox"
"github.com/mitchellh/packer/packer/plugin"
)
func main() {
plugin.ServeBuilder(new(virtualbox.Builder))
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment