forked from DevotedHealth/terraform-provider-looker
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMakefile
44 lines (34 loc) · 1.19 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
VERSION=$(shell cat VERSION)
export BASE_BINARY_NAME=terraform-provider-looker_v$(VERSION)
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: vendor
vendor: go.sum ## vendor dependencies
@go mod vendor
@go mod tidy
.PHONY: lint
lint: ## run linter
@golangci-lint run ./...
.PHONY: test
test: ## run tests
@go test -v -cover -race $(shell go list ./... | grep -v vendor)
.PHONY: test-acceptance
test-acceptance: ## runs all tests, including the acceptance tests
@TF_ACC=1 $(go_test) go test -v -cover $(shell go list ./... | grep -v vendor)
.PHONY: build
build: ## build binary
@go build -o build/$(BASE_BINARY_NAME) .
.PHONY: docs
docs: ## generate docs
@go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
.PHONY: check-docs
check-docs: docs ## check that docs have been generated
@git diff --exit-code -- docs
.PHONY: check-mod
check-mod: ## check go.mod is up-to-date
@go mod tidy
@git diff --exit-code -- go.mod go.sum
.PHONY: install
install:
@go build -o ~/.terraform.d/plugins/registry.terraform.io/hirosassa/looker/${VERSION}/darwin_amd64/terraform-provider-looker