diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d9b4f01 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/build/* diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ca9d560 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +VERSION=$(shell git describe --tags --candidates=1 --dirty 2>/dev/null || echo "dev") +FLAGS=-s -w -X main.Version=$(VERSION) +SRC=$(shell find . -type f -name '*.go' -not -path "./vendor/*") + +ecs-run-task: $(SRC) + go build -o ecs-run-task -ldflags="$(FLAGS)" -v . + +.PHONY: test +test: + gofmt -s -l -w $(SRC) + go vet -v ./... + go test -race -v ./... + +.PHONY: clean +clean: + rm -f ecs-run-task + +.PHONY: release +release: + go get github.com/mitchellh/gox + gox -ldflags="$(FLAGS)" -output="build/{{.Dir}}-{{.OS}}-{{.Arch}}" -osarch="linux/amd64 windows/amd64" .