builder/amazonebs, plugin/builder-amazon-ebs

This commit is contained in:
Mitchell Hashimoto 2013-05-08 22:34:20 -07:00
parent c164b4c23c
commit d6efe3c757
6 changed files with 61 additions and 22 deletions

View File

@ -10,6 +10,8 @@ all:
go get -d -v ./...
@echo "$(OK_COLOR)--> Compiling Packer...$(NO_COLOR)"
go build -v -o bin/packer
@echo "$(OK_COLOR)--> Compiling Builder: Amazon EBS...$(NO_COLOR)"
$(MAKE) -C plugin/builder-amazon-ebs
@echo "$(OK_COLOR)--> Compiling Command: Build...$(NO_COLOR)"
$(MAKE) -C plugin/command-build

View File

@ -1,22 +0,0 @@
package amazon
type config struct {
AccessKey string
Region string
SecretKey string
SourceAmi string
}
type Builder struct {
config config
}
func (b *Builder) ConfigInterface() interface{} {
return &b.config
}
func (*Builder) Prepare() {
}
func (b *Builder) Build() {
}

View File

@ -0,0 +1,20 @@
package amazonebs
import (
"github.com/mitchellh/packer/packer"
)
type config struct {
AccessKey string
Region string
SecretKey string
SourceAmi string
}
type Builder struct {
config config
}
func (*Builder) Prepare(interface{}) {}
func (*Builder) Run(packer.Build, packer.Ui) {}

View File

@ -0,0 +1,14 @@
package amazonebs
import (
"cgl.tideland.biz/asserts"
"github.com/mitchellh/packer/packer"
"testing"
)
func TestBuilder_ImplementsBuilder(t *testing.T) {
assert := asserts.NewTestingAsserts(t, true)
var actual packer.Builder
assert.Implementor(&Builder{}, &actual, "should be a Builder")
}

View File

@ -0,0 +1,15 @@
PLUGIN_NAME=packer-builder-amazon-ebs
plugin:
go get -d -v ./...
go build -v -o $(ROOTDIR)/bin/$(PLUGIN_NAME)
format:
go fmt ./...
test:
@go list -f '{{range .TestImports}}{{.}}\
{{end}}' ./... | xargs -n1 go get -d
go test ./...
.PHONY: all format test

View File

@ -0,0 +1,10 @@
package main
import (
"github.com/mitchellh/packer/builder/amazonebs"
"github.com/mitchellh/packer/packer/plugin"
)
func main() {
plugin.ServeBuilder(new(amazonebs.Builder))
}