forked from reetasingh/terraform-provider-policy-sentry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (29 loc) · 898 Bytes
/
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
TEST?=$$(go list ./... | grep -v 'vendor')
BINARY=terraform-provider-policy-sentry
# go source files, ignore vendor directory
SRC = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
default: install
build:
go build -o ${BINARY}
install: build
mv ${BINARY} ~/.terraform.d/plugins
fmt:
@gofmt -l -w $(SRC)
lint:
golangci-lint run
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
validate-modules:
@echo "- Verifying that the dependencies have expected content..."
go mod verify
@echo "- Checking for any unused/missing packages in go.mod..."
go mod tidy
@echo "- Checking for unused packages in vendor..."
go mod vendor
@git diff --exit-code -- go.sum go.mod vendor/
terraform-demo: install
cd examples && terraform init && terraform apply