-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
47 lines (37 loc) · 1.01 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
# This is used mostly for development.
GOOS := $(shell go env GOOS)
GOARCH := $(shell go env GOARCH)
VERSION := 0.1.0
# This is used mostly for development as this is how Terraform
# reads the plugin from the local plugins folder.
REGISTRY := github.com
ORG := amalucelli
NAME := nextdns
# Terraform requieres a specific format.
BINARY := terraform-provider-${NAME}
.PHONY: build
build:
@go build -o ${BINARY}
.PHONY: install
install: build
@mkdir -p ~/.terraform.d/plugins/${REGISTRY}/${ORG}/${NAME}/${VERSION}/${GOOS}_${GOARCH}
@mv ${BINARY} ~/.terraform.d/plugins/${REGISTRY}/${ORG}/${NAME}/${VERSION}/${GOOS}_${GOARCH}
.PHONY: clean
clean:
@rm -rf examples/.terraform* examples/terraform.*
.PHONY: test
test:
@go test ./...
.PHONY: lint
lint:
@golangci-lint run ./...
.PHONY: tflint
tflint:
@tfproviderlint ./...
.PHONY: fmt
fmt:
@gofmt -s -w .
.PHONY: tools
tools:
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
@go install github.com/bflad/tfproviderlint/cmd/tfproviderlint@latest