forked from databricks/terraform-provider-databricks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
85 lines (66 loc) · 3.16 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
default: build
fmt:
@echo "✓ Formatting source code with goimports ..."
@go run golang.org/x/tools/cmd/goimports@latest -w $(shell find . -type f -name '*.go' -not -path "./vendor/*")
@echo "✓ Formatting source code with gofmt ..."
@gofmt -w $(shell find . -type f -name '*.go' -not -path "./vendor/*")
fmt-docs:
@echo "✓ Formatting code samples in documentation"
@terrafmt fmt -p '*.md' .
lint: vendor
@echo "✓ Linting source code with https://staticcheck.io/ ..."
@go run honnef.co/go/tools/cmd/[email protected] ./...
test: lint
@echo "✓ Running tests ..."
@go run gotest.tools/gotestsum@latest --format pkgname-and-test-fails --no-summary=skipped --raw-command go test -v -json -short -coverprofile=coverage.txt ./...
coverage: test
@echo "✓ Opening coverage for unit tests ..."
@go tool cover -html=coverage.txt
build: vendor
@echo "✓ Building source code with go build ..."
@go build -mod vendor -v -o terraform-provider-databricks
install: build
@echo "✓ Installing provider for Terraform 1.0+ into ~/.terraform.d/plugins ..."
@mkdir -p '$(HOME)/.terraform.d/plugins/registry.terraform.io/databricks/databricks/$(shell ./terraform-provider-databricks version)/$(shell go version | awk '{print $$4}' | sed 's#/#_#')'
@cp terraform-provider-databricks '$(HOME)/.terraform.d/plugins/registry.terraform.io/databricks/databricks/$(shell ./terraform-provider-databricks version)/$(shell go version | awk '{print $$4}' | sed 's#/#_#')/terraform-provider-databricks'
@echo "✓ Use the following configuration to enable the version you've built"
@echo
@echo "terraform {"
@echo " required_providers {"
@echo " databricks = {"
@echo ' source = "databricks/databricks"'
@echo ' version = "$(shell ./terraform-provider-databricks version)"'
@echo " }"
@echo " }"
@echo "}"
vendor:
@echo "✓ Filling vendor folder with library code ..."
@go mod vendor
test-azcli: install
@echo "✓ Running Terraform Acceptance Tests for Azure..."
@/bin/bash scripts/run.sh azcli '^TestAzureAcc' --debug --tee
test-azsp: install
@echo "✓ Running Terraform Acceptance Tests for Azure..."
@/bin/bash scripts/run.sh azsp '^(TestAcc|TestAzureAcc)' --debug --tee
test-mws: install
@echo "✓ Running acceptance Tests for Multiple Workspace APIs on AWS..."
@/bin/bash scripts/run.sh mws '^TestMwsAcc' --debug --tee
test-awsmt: install
@echo "✓ Running Terraform Acceptance Tests for AWS MT..."
@/bin/bash scripts/run.sh awsmt '^(TestAcc|TestAwsAcc)' --debug --tee
test-gcp-accounts: install
@echo "✓ Running acceptance Tests for Multiple Workspace APIs on GCP..."
@/bin/bash scripts/run.sh gcp-accounts '^TestGcpaAcc' --debug --tee
test-gcp: install
@echo "✓ Running acceptance Tests for GCP..."
@/bin/bash scripts/run.sh gcp '^(TestAcc|TestGcpAcc)' --debug --tee
test-preview: install
@echo "✓ Running acceptance Tests for Preview features..."
@/bin/bash scripts/run.sh preview '^TestPreviewAcc' --debug --tee
docker-it:
docker build -t databricks-terrafrom/test -f scripts/Dockerfile .
schema:
@/bin/bash scripts/print-schema.sh
diff-schema:
@/bin/bash scripts/diff-schema.sh
.PHONY: build fmt python-setup docs vendor build fmt coverage test lint