-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
45 lines (33 loc) · 1.06 KB
/
Makefile
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
33
34
35
36
37
38
39
40
41
42
43
44
45
TEST?=$$(go list ./... | grep -v 'vendor')
HOSTNAME=registry.terraform.io
NAMESPACE=netrisai
NAME=netris
BINARY=terraform-provider-${NAME}
VERSION=3.6.2
OS_ARCH=darwin_arm64
WORKDIRECTORY=examples
default: install
build:
go build -o ${BINARY}
install: build
mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
mv ${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
uninstall:
rm -rf ${WORKDIRECTORY}/.terraform*
uninstall-all:
rm -rf ${WORKDIRECTORY}/.terraform*
rm -rf ${WORKDIRECTORY}/*.tfstate*
init: install
cd ${WORKDIRECTORY} && terraform init
apply: init
cd ${WORKDIRECTORY} && terraform apply
plan: init
cd ${WORKDIRECTORY} && terraform plan
destroy:
cd ${WORKDIRECTORY} && terraform destroy -auto-approve
reapply: destroy uninstall apply
test:
go test -i $(TEST) || exit 1
echo $(TEST) | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4
testacc:
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m