forked from RedisLabs/terraform-provider-rediscloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
41 lines (31 loc) · 1.41 KB
/
GNUmakefile
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
default: testacc
PROVIDER_HOSTNAME=registry.terraform.io
PROVIDER_NAMESPACE=RedisLabs
PROVIDER_TYPE=rediscloud
PROVIDER_TARGET=$(shell go env GOOS)_$(shell go env GOARCH)
PROVIDER_VERSION = 99.99.99
PLUGINS_PATH = ~/.terraform.d/plugins
PLUGINS_PROVIDER_PATH=$(PROVIDER_HOSTNAME)/$(PROVIDER_NAMESPACE)/$(PROVIDER_TYPE)/$(PROVIDER_VERSION)/$(PROVIDER_TARGET)
# Use a parallelism of 3 by default for tests, overriding whatever GOMAXPROCS is set to.
TEST_PARALLELISM?=3
TESTARGS?=-short
.PHONY: build clean testacc install_local website website-test tfproviderlint
build:
@echo "Building local provider binary"
@mkdir -p ./bin
go build -o bin/terraform-provider-rediscloud_v$(PROVIDER_VERSION)
@sh -c "'$(CURDIR)/scripts/generate-dev-overrides.sh'"
clean:
@echo "Deleting local provider binary"
rm -rf ./bin
testacc:
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m -parallel=$(TEST_PARALLELISM)
install_local: build
@echo "Installing local provider binary to plugins mirror path $(PLUGINS_PATH)/$(PLUGINS_PROVIDER_PATH)"
@mkdir -p $(PLUGINS_PATH)/$(PLUGINS_PROVIDER_PATH)
@cp ./bin/terraform-provider-rediscloud_v$(PROVIDER_VERSION) $(PLUGINS_PATH)/$(PLUGINS_PROVIDER_PATH)
sweep:
@echo "WARNING: This will destroy infrastructure. Use only in development accounts."
go test ./internal/provider -v -sweep=ALL $(SWEEPARGS) -timeout 30m
tfproviderlint:
@go run github.com/bflad/tfproviderlint/cmd/tfproviderlint ./...