Create the build command/plugin
This commit is contained in:
parent
399d8ab028
commit
91ade277a6
9
Makefile
9
Makefile
|
@ -1,12 +1,21 @@
|
|||
NO_COLOR=\x1b[0m
|
||||
OK_COLOR=\x1b[32;01m
|
||||
ERROR_COLOR=\x1b[31;01m
|
||||
WARN_COLOR=\x1b[33;01m
|
||||
|
||||
all:
|
||||
@mkdir -p bin/
|
||||
go get -d -v ./...
|
||||
@echo "$(OK_COLOR)--> Compiling Packer...$(NO_COLOR)"
|
||||
go build -v -o bin/packer
|
||||
@echo "$(OK_COLOR)--> Compiling Command: Build...$(NO_COLOR)"
|
||||
$(MAKE) -C plugin/command-build
|
||||
|
||||
format:
|
||||
go fmt ./...
|
||||
|
||||
test:
|
||||
@echo "$(OK_COLOR)--> Testing Packer...$(NO_COLOR)"
|
||||
@go list -f '{{range .TestImports}}{{.}}\
|
||||
{{end}}' ./... | xargs -n1 go get -d
|
||||
go test ./...
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package main
|
||||
package build
|
||||
|
||||
import "github.com/mitchellh/packer/packer"
|
||||
|
||||
type buildCommand byte
|
||||
type Command byte
|
||||
|
||||
func (Command) Run(env packer.Environment, arg []string) int {
|
||||
env.Ui().Say("BUILDING!")
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
package build
|
||||
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
package main
|
||||
|
||||
import "github.com/mitchellh/packer/packer/plugin"
|
||||
|
||||
func main() {
|
||||
plugin.ServeCommand(new(buildCommand))
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
plugin:
|
||||
go get -d -v ./...
|
||||
go build -v -o $(CURDIR)/bin/packer-build
|
||||
|
||||
format:
|
||||
go fmt ./...
|
||||
|
||||
test:
|
||||
@go list -f '{{range .TestImports}}{{.}}\
|
||||
{{end}}' ./... | xargs -n1 go get -d
|
||||
go test ./...
|
||||
|
||||
.PHONY: all format test
|
Binary file not shown.
|
@ -0,0 +1,10 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/mitchellh/packer/command/build"
|
||||
"github.com/mitchellh/packer/packer/plugin"
|
||||
)
|
||||
|
||||
func main() {
|
||||
plugin.ServeCommand(new(build.Command))
|
||||
}
|
Loading…
Reference in New Issue