-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
41 lines (29 loc) · 921 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
HOSTNAME = kentik
NAMESPACE = automation
NAME = kentik-cloudexport
BINARY = terraform-provider-${NAME}
VERSION := $(shell echo `git tag --list 'v*' | tail -1 | cut -d v -f 2` | sed -e 's/^$$/0.1.0/')
OS_ARCH := $(shell printf "%s_%s" `go env GOHOSTOS` `go env GOHOSTARCH`)
default: install
build:
go mod tidy
go build -o ${BINARY}
check-docs:
./tools/check_docs.sh
check-go-mod:
./tools/check_go_mod.sh
docs:
go generate
fmt:
./tools/fmt.sh
install: build
mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
mv ${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
lint:
golangci-lint run
test:
go test ./... -timeout=5m
acceptance:
TF_ACC=1 TF_ACC_PREFIX=$(shell date --iso-8601=seconds).${TF_ACC_TERRAFORM_VERSION} go test ./... -timeout=5m
go test ./... -sweep -timeout=5m
.PHONY: build check-docs docs fmt install lint test