generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Makefile
43 lines (31 loc) · 978 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
43
GOOS=$(shell go env GOOS)
GOARCH=$(shell go env GOARCH)
PROVIDER=astra
DEV_VERSION=0.0.1
PLUGIN_PATH=registry.terraform.io/datastax/$(PROVIDER)/$(DEV_VERSION)/$(GOOS)_$(GOARCH)
TF_PLUGIN_DOCS_VERSION=v0.18.0
ifeq ($(GOOS), "windows")
INSTALL_PATH=%APPDATA%/terraform.d/plugins/$(PLUGIN_PATH)
else
INSTALL_PATH=~/.terraform.d/plugins/$(PLUGIN_PATH)
endif
default: build
build:
mkdir -p bin
go build -o bin/terraform-provider-$(PROVIDER)
install: build
mkdir -p $(INSTALL_PATH)
cp bin/terraform-provider-$(PROVIDER) $(INSTALL_PATH)
dev: install
test: testacc
testacc:
test/run_tests.sh
clean:
rm -f bin/terraform-provider-$(PROVIDER)
tools:
go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@$(TF_PLUGIN_DOCS_VERSION)
type terraform || (echo "'terraform' command not found, please install it" && exit 1)
docs: tools
terraform fmt --recursive ./examples
tfplugindocs
.PHONY: install build clean dev docs test testacc tools