generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGNUmakefile
29 lines (24 loc) · 870 Bytes
/
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
TEST?=$$(go list ./... | grep -v 'vendor')
HOSTNAME=registry.terraform.io
NAMESPACE=hkak03key
MKFILE_PATH=$(abspath $(lastword $(MAKEFILE_LIST)))
BINARY=$(notdir $(patsubst %/,%,$(dir $(MKFILE_PATH))))
NAME=$(shell echo $(BINARY) | sed "s/terraform-provider-//")
VERSION=0.0.1
OS_ARCH=linux_amd64
default: testacc
.PHONY: build
build:
go build -o ${BINARY}
.PHONY: install
install: build
mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
mv ${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
.PHONY: test
test:
go test -i $(TEST) || exit 1
echo $(TEST) | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4
# Run acceptance tests
.PHONY: testacc
testacc:
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m