-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
34 lines (23 loc) · 1.13 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
.PHONY: build test testacc vet lint release
plugin_name=terraform-provider-appoptics
default: build
build:
go build -o $(plugin_name)
buildall:
env CGO_ENABLED= GOOS="linux" GOARCH="amd64" go build -trimpath -buildmode=pie -ldflags "-s -w" -o build/$(plugin_name)-linux-amd64
env CGO_ENABLED= GOOS="linux" GOARCH="arm64" go build -trimpath -buildmode=pie -ldflags "-s -w" -o build/$(plugin_name)-linux-arm64
env CGO_ENABLED= GOOS="darwin" GOARCH="amd64" go build -trimpath -buildmode=pie -ldflags "-s -w" -o build/$(plugin_name)-darwin-amd64
env CGO_ENABLED= GOOS="darwin" GOARCH="arm64" go build -trimpath -buildmode=pie -ldflags "-s -w" -o build/$(plugin_name)-darwin-arm64
env CGO_ENABLED= GOOS="windows" GOARCH="amd64" go build -trimpath -buildmode=pie -ldflags "-s -w" -o build/$(plugin_name)-windows-amd64
cd build && sha256sum -b * > checksums_sha256.txt
test:
go test ./...
testacc:
TF_ACC=1 go test -v -timeout 120m
vet:
go vet ./...
lint:
"$$(go env GOPATH)/bin/golangci-lint" run
# Convenient in dev to rebuild the plugin, re-init TF, and run a plan
bounce: build
rm -f *.tfstate* && terraform init && terraform plan