Commit 03d7a7f6 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/digitalocean: Adhere to new interface, make default in Packer

@pearkes: I added "digital-ocean" to the default config since it will
be shipping with Packer. :)
parent a76a9e86
...@@ -42,9 +42,12 @@ type Builder struct { ...@@ -42,9 +42,12 @@ type Builder struct {
runner multistep.Runner runner multistep.Runner
} }
func (b *Builder) Prepare(raw interface{}) error { func (b *Builder) Prepare(raws ...interface{}) error {
if err := mapstructure.Decode(raw, &b.config); err != nil { for _, raw := range raws {
return err err := mapstructure.Decode(raw, &b.config)
if err != nil {
return err
}
} }
// Optional configuration with defaults // Optional configuration with defaults
......
...@@ -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",
"digital-ocean": "packer-builder-digital-ocean",
"virtualbox": "packer-builder-virtualbox", "virtualbox": "packer-builder-virtualbox",
"vmware": "packer-builder-vmware" "vmware": "packer-builder-vmware"
}, },
......
...@@ -2,7 +2,7 @@ package main ...@@ -2,7 +2,7 @@ package main
import ( import (
"github.com/mitchellh/packer/packer/plugin" "github.com/mitchellh/packer/packer/plugin"
"github.com/pearkes/packer/builder/digitalocean" "github.com/mitchellh/packer/builder/digitalocean"
) )
func main() { func main() {
......
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