generated from hashicorp/terraform-provider-scaffolding
-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
GNUmakefile
32 lines (24 loc) · 1.02 KB
/
GNUmakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
TEST?=$$(go list ./... | grep -v 'vendor')
HOSTNAME=hashicorp.com
NAMESPACE=kislerdm
NAME=neon
VERSION=dev
BINARY=terraform-provider-${NAME}_v${VERSION}
OS_ARCH=darwin_arm64
.PHONY: testacc build install test
help: ## Prints help message.
@ grep -h -E '^[a-zA-Z0-9_-].+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[1m%-30s\033[0m %s\n", $$1, $$2}'
default: help
build:
@ go build -a -gcflags=all="-l -B -C" -ldflags="-w -s -X main.version=$(VERSION)" -o ${BINARY} .
install: build ## Builds and installs the provider.
@ mkdir -p ~/.terraform.d/plugins/local/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
@ mv ${BINARY} ~/.terraform.d/plugins/local/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}/
@ echo Local provider: local/${NAMESPACE}/${NAME}
test: ## Runs unit tests.
@ go test $(TEST) || exit 1
@ echo $(TEST) | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4
testacc: ## Runs acceptance tests.
@ TF_ACC=1 go test -tags=acceptance -v -timeout 120m ./...
docu: ## Generates docu.
@ go generate