packer-cn/builder/amazonebs/builder.go

36 lines
585 B
Go
Raw Normal View History

package amazonebs
import (
2013-05-09 16:19:38 -04:00
"encoding/json"
"github.com/mitchellh/packer/packer"
2013-05-09 16:26:40 -04:00
"log"
)
type config struct {
2013-05-09 16:19:38 -04:00
AccessKey string `json:"access_key"`
Region string
2013-05-09 16:19:38 -04:00
SecretKey string `json:"secret_key"`
SourceAmi string `json:"source_ami"`
}
type Builder struct {
config config
}
2013-05-09 16:19:38 -04:00
func (b *Builder) Prepare(raw interface{}) (err error) {
jsonBytes, err := json.Marshal(raw)
if err != nil {
return
}
err = json.Unmarshal(jsonBytes, &b.config)
if err != nil {
return
}
2013-05-09 16:26:40 -04:00
log.Printf("Config: %+v\n", b.config)
2013-05-09 16:19:38 -04:00
return
}
func (*Builder) Run(packer.Build, packer.Ui) {}