forked from canonical/terraform-provider-maas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (39 loc) · 1.45 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
TEST?=$$(go list ./... | grep -v 'vendor')
HOSTNAME=registry.terraform.io
NAMESPACE=maas
NAME=maas
BINARY=terraform-provider-${NAME}
VERSION=1.0.1
OS?=$$(go env GOOS)
ARCH?=$$(go env GOARCH)
TEST_PARALLELISM?=4
default: install
BIN=$(CURDIR)/bin
$(BIN)/%:
@echo "Installing tools from tools/tools.go"
@cat tools/tools.go | grep _ | awk -F '"' '{print $$2}' | GOBIN=$(BIN) xargs -tI {} go install {}
.PHONY: build install clean clean_install test testacc generate_docs validate_docs tfproviderlintx tfproviderlint
build:
mkdir -p $(BIN)
go build -o $(BIN)/${BINARY}
create_dev_overrides: build
@sh -c "'$(CURDIR)/scripts/generate-dev-overrides.sh'"
install: build
mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS}_${ARCH}
mv $(BIN)/${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS}_${ARCH}
clean:
rm -rf $(BIN)
clean_install: clean
rm -rf ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}
test:
go test $(TEST) -v $(TESTARGS) -timeout=5m -parallel=$(TEST_PARALLELISM)
testacc:
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m -parallel=$(TEST_PARALLELISM)
generate_docs: $(BIN)/tfplugindocs
$(BIN)/tfplugindocs generate --provider-name $(NAME)
validate_docs: $(BIN)/tfplugindocs
$(BIN)/tfplugindocs validate
tfproviderlintx: $(BIN)/tfproviderlint
$(BIN)/tfproviderlintx $(TFPROVIDERLINT_ARGS) ./...
tfproviderlint: $(BIN)/tfproviderlintx
$(BIN)/tfproviderlint $(TFPROVIDERLINT_ARGS) ./...