builder/amazonebs, plugin/builder-amazon-ebs
This commit is contained in:
parent
c164b4c23c
commit
d6efe3c757
2
Makefile
2
Makefile
|
@ -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
|
||||
|
||||
|
|
|
@ -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() {
|
||||
}
|
|
@ -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) {}
|
|
@ -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")
|
||||
}
|
|
@ -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
|
|
@ -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))
|
||||
}
|
Loading…
Reference in New Issue