-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
60 lines (49 loc) · 1.2 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
NAME=prefect
BINARY=terraform-provider-${NAME}
default: build
.PHONY: default
help:
@echo "Usage: $(MAKE) [target]"
@echo ""
@echo "This project defines the following build targets:"
@echo ""
@echo " build - compiles source code to build/"
@echo " clean - removes built artifacts"
@echo " lint - run static code analysis"
@echo " test - run automated unit tests"
@echo " testacc - run automated acceptance tests"
@echo " docs - builds Terraform documentation"
@echo " dev-new - creates a new dev testfile (args: resource=<resource> name=<name>)"
@echo " dev-clean - cleans up dev directory"
.PHONY: help
build: $(BINARY)
.PHONY: build
$(BINARY):
mkdir -p build/
go build -o build/$(BINARY)
.PHONY: $(BINARY)
clean:
rm -vrf build/
.PHONY: clean
lint:
golangci-lint run
.PHONY: lint
test:
gotestsum --max-fails=50 ./...
.PHONY: test
# NOTE: Acceptance Tests create real infrastructure
# against a dedicated testing account
testacc:
TF_ACC=1 make test
.PHONY: testacc
docs:
mkdir -p docs
rm -rf ./docs/images
go generate ./...
.PHONY: docs
dev-new:
sh ./create-dev-testfile.sh $(resource) $(name)
.PHONY: dev-new
dev-clean:
rm -rf ./dev
.PHONY: dev-clean