diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..1e5304e --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,10 @@ +default: testacc + +# Run acceptance tests +.PHONY: testacc +testacc: + TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m + +.PHONY: update +update: + go get diff --git a/Makefile b/Makefile deleted file mode 100644 index a69a891..0000000 --- a/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -.DEFAULT_GOAL := build -OS := $(shell go env GOOS) -ARCH := $(shell go env GOARCH) -PLUGIN_PATH := ${HOME}/.terraform.d/plugins/${OS}_${ARCH} -PLUGIN_NAME := terraform-provider-petstore -DIST_PATH := dist/${OS}_${ARCH} -GO_PACKAGES := $(shell go list ./... | grep -v /vendor/) -GO_FILES := $(shell find . -type f -name '*.go') - - -.PHONY: all -all: clean test build - -.PHONY: test -test: test-all - -.PHONY: test-all -test-all: - @TF_ACC=1 go test -v -race $(GO_PACKAGES) - -${DIST_PATH}/${PLUGIN_NAME}: ${GO_FILES} - mkdir -p $(DIST_PATH); \ - go build -o $(DIST_PATH)/${PLUGIN_NAME} - -.PHONY: build -build: ${DIST_PATH}/${PLUGIN_NAME} - -.PHONY: install -install: build - mkdir -p $(PLUGIN_PATH); \ - rm -rf $(PLUGIN_PATH)/${PLUGIN_NAME}; \ - install -m 0755 $(DIST_PATH)/${PLUGIN_NAME} $(PLUGIN_PATH)/${PLUGIN_NAME} - -.PHONY: clean -clean: - rm -rf ${DIST_PATH}/* - -.PHONY: update -update: - go get \ No newline at end of file