forked from sitehostnz/terraform-provider-sitehost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGNUmakefile
57 lines (45 loc) · 1.31 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
TEST?=$$(go list ./... | grep -v 'vendor')
HOSTNAME=hashicorp.com
NAMESPACE=sh
NAME=sitehost
BINARY=terraform-provider-${NAME}
VERSION=1.2.0
OS_ARCH=linux_amd64
SRC := go.sum $(shell git ls-files -cmo --exclude-standard -- "*.go")
TESTABLE := ./...
default: install
build:
go build -o ${BINARY}
release:
goreleaser release --rm-dist --snapshot --skip-publish --skip-sign
install: build
mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
mv ${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
test:
go test -i $(TEST) || exit 1
echo $(TEST) | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4
testacc:
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m -parallel 10 -short
bin/golangci-lint: GOARCH =
bin/golangci-lint: GOOS =
bin/golangci-lint: go.sum
@go build -o $@ github.com/golangci/golangci-lint/cmd/golangci-lint
bin/go-acc: GOARCH =
bin/go-acc: GOOS =
bin/go-acc: go.sum
@go build -o $@ github.com/ory/go-acc
lint: CGO_ENABLED = 1
lint: GOARCH =
lint: GOOS =
lint: bin/golangci-lint $(SRC)
$< run --max-same-issues 50
tidy:
go mod tidy
dirty: tidy
git status --porcelain
@[ -z "$$(git status --porcelain)" ]
vet: GOARCH =
vet: GOOS =
vet: CGO_ENABLED =
vet: bin/go-acc $(SRC)
$< --covermode=atomic $(TESTABLE) -- -race -v