-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (33 loc) · 902 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
40
41
42
.DEFAULT_GOAL:=help
BIN=provdoc
DEMODIR=demo
.PHONY: build
build: clean ## Build binaries
@go build -o $(BIN)
.PHONY: clean
clean: ## Clean up binaries
@rm -f $(BIN)
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-12s\033[0m %s\n", $$1, $$2}'
.PHONY: lint
lint: ## Lint source code
@golangci-lint run ./...
.PHONY: record-demo
record-demo: ## Record a demo
@go build -o $(BIN)
@mv $(BIN) $(DEMODIR)/
@cd $(DEMODIR) && \
vhs demo.tape && \
rm $(BIN)
.PHONY: regen-schema
regen-schema: ## Re-generate provider schema data
@cd $(DEMODIR) && \
terraform init && \
terraform providers schema -json > schema.json
.PHONY: test
test: ## Run unit tests
@go test -v -coverprofile=coverage.txt ./...
.PHONY: view-demo
view-demo: ## View demo gif in the browser
@open $(DEMODIR)/demo.gif -a 'Google Chrome'