forked from site24x7/terraform-provider-site24x7
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (30 loc) · 893 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
.DEFAULT_GOAL := help
BINARY := terraform-provider-site24x7
TEST_FLAGS ?= -race
PKGS ?= $(shell go list ./... | grep -v /vendor/)
.PHONY: help
help:
@grep -E '^[a-zA-Z-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "[32m%-12s[0m %s\n", $$1, $$2}'
.PHONY: build
build: ## build terraform-provider-site24x7
go build \
-ldflags "-s -w" \
-o $(BINARY) \
main.go
.PHONY: install
install: build ## install terraform-provider-site24x7
mkdir -p $(HOME)/.terraform.d/plugins
cp $(BINARY) $(HOME)/.terraform.d/plugins
.PHONY: test
test: ## run tests
go test $(TEST_FLAGS) $(PKGS)
.PHONY: vet
vet: ## run go vet
go vet $(PKGS)
.PHONY: coverage
coverage: ## generate code coverage
go test $(TEST_FLAGS) -covermode=atomic -coverprofile=coverage.txt $(PKGS)
go tool cover -func=coverage.txt
.PHONY: lint
lint: ## run golangci-lint
golangci-lint run