generated from hashicorp/terraform-provider-scaffolding-framework
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGNUmakefile
44 lines (37 loc) · 962 Bytes
/
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
42
43
44
default: testacc
PKG_NAME = prowlarr
# Local provider install parameters
version = 0.1.0
registry_name = registry.terraform.io
namespace = $(PKG_NAME)
bin_name = terraform-provider-$(PKG_NAME)
build_dir = .build
TF_PLUGIN_DIR ?= ~/.local/share/terraform/plugins
install_path = $(TF_PLUGIN_DIR)/$(registry_name)/$(namespace)/$(PKG_NAME)/$(version)/$$(go env GOOS)_$$(go env GOARCH)
# Run acceptance tests
.PHONY: testacc
testacc:
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m
# Build plugin binary
.PHONY: build
build:
mkdir -p $(build_dir)
go build -tags all -o $(build_dir)/$(bin_name)
# Install the binary in the plugin directory
.PHONY: install
install: build
mkdir -p $(install_path)
cp $(build_dir)/$(bin_name) $(install_path)/$(bin_name)
# Generate documentation
.PHONY: doc
doc: lint
go generate ./...
# Lint
.PHONY: lint
lint: fmt
golangci-lint run ./...
# Format
.PHONY: fmt
fmt:
go fmt ./...
terraform fmt --recursive ./examples/