-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
48 lines (39 loc) · 1.12 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
48
HOSTNAME=github.com
NAMESPACE=iterative
NAME=iterative
VERSION=0.0.${shell date +%s}+development
GOOS=${shell go env GOOS}
GOARCH=${shell go env GOARCH}
TF_PLUGIN_INSTALL_PATH=~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${GOOS}_${GOARCH}
TPI_PATH ?= $(shell pwd)
LEO_PATH ?= $(shell pwd)/cmd/leo
GO_LINK_FLAGS ?= -s -w -X terraform-provider-iterative/iterative/utils.Version=${VERSION}
default: build
.PHONY: build
build: tpi leo
.PHONY: install
install: install-tpi
.PHONY: tpi
tpi:
CGO_ENABLED=0 \
go build -ldflags="$(GO_LINK_FLAGS)" \
-o "$(shell pwd)/terraform-provider-iterative" \
"$(TPI_PATH)"
.PHONY: leo
leo:
CGO_ENABLED=0 \
go build -ldflags="$(GO_LINK_FLAGS)" \
-o "$(shell pwd)/leo" \
"$(LEO_PATH)"
.PHONY: install-tpi
install-tpi:
GOBIN=${TF_PLUGIN_INSTALL_PATH} go install -ldflags="$(GO_LINK_FLAGS)" "$(TPI_PATH)"
.PHONY: test
test:
go test ./... ${TESTARGS} -timeout=30s -parallel=4
.PHONY: smoke
smoke:
go test ./task -v ${TESTARGS} -timeout=30m -count=1 -tags=smoke
.PHONY: sweep
sweep:
SMOKE_TEST_SWEEP=true go test ./task -v ${TESTARGS} -timeout=30m -count=1