-
Notifications
You must be signed in to change notification settings - Fork 354
/
Makefile
86 lines (65 loc) · 2.49 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
default: build
test:
@echo "==> Running tests..."
@gotestsum --raw-command go test -v -json -short -coverprofile=coverage.out ./...
int:
@echo "==> Running tests..."
@gotestsum --raw-command go test -v -json -coverprofile=coverage.out ./...
coverage: test
@echo "==> Opening coverage for unit tests..."
@go tool cover -html=coverage.out
coverage-int: int
@echo "==> Opening coverage for unit tests..."
@go tool cover -html=coverage.out
int-build: int build
build: fmt
@echo "==> Building source code with go build..."
@go build -mod vendor -v -o terraform-provider-databricks
lint:
@echo "==> Linting source code with golint..."
@golint -set_exit_status ./databricks/... ./client/...
fmt: lint
@echo "==> Formatting source code with gofmt..."
@go fmt ./...
python-setup:
@echo "==> Setting up virtual env and installing python libraries..."
@python -m pip install virtualenv
@cd docs && python -m virtualenv venv
@cd docs && source venv/bin/activate && python -m pip install -r requirements.txt
docs: python-setup
@echo "==> Building Docs ..."
@cd docs && source venv/bin/activate && make clean && make html
opendocs: python-setup docs
@echo "==> Opening Docs ..."
@cd docs && open build/html/index.html
singlehtmldocs: python-setup
@echo "==> Building Docs ..."
@cd docs && source venv/bin/activate && make clean && make singlehtml
vendor:
@echo "==> Filling vendor folder with library code..."
@go mod vendor
# INTEGRATION TESTING WITH TERRAFORM EXAMPLES
terraform-acc: fmt build
@echo "==> Running Terraform Acceptance Tests..."
@TF_ACC=1 go test -v -short ./databricks/...
terraform-setup: build
@echo "==> Initializing Terraform..."
@terraform init
terraform-apply: terraform-setup
@echo "==> Initializing Terraform plan..."
@TF_LOG_PATH=log.out TF_LOG=debug terraform apply
snapshot:
@echo "==> Making Snapshot..."
@goreleaser release --rm-dist --snapshot
@cp dist/*.gz website/content/_index.files/
@cp dist/*.zip website/content/_index.files/
hugo: snapshot
@echo "==> Making Docs..."
@rm -rf terraform-provider-databricks website/content/_index.files/*
@cp dist/*.gz website/content/_index.files/
@cp dist/*.zip website/content/_index.files/
@cd website && hugo
internal-docs-sync:
@echo "==> Uploading Website..."
@azcopy login --service-principal --application-id $(AZCOPY_SPA_CLIENT_ID) --tenant-id=$(AZCOPY_SPA_TENANT_ID) && azcopy sync './website/public' '$(AZCOPY_STORAGE_ACCT)' --recursive
.PHONY: build fmt python-setup docs vendor terraform-local build fmt coverage test