-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
45 lines (37 loc) · 946 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
41
42
43
44
45
PROJECT_NAME := terraform-provider-kafka
package = github.com/packetloop/$(PROJECT_NAME)
.PHONY: test
test: dep env
HOST_URL=$(HOST_URL) TF_ACC=$(TF_ACC) go test -race -cover -v ./...
.PHONY: dep
dep:
$(eval GO111MODULE := on)
go get github.com/hashicorp/terraform-plugin-sdk@v1.4.1
go get github.com/tcnksm/ghr
go get github.com/mitchellh/gox
go mod tidy
go mod vendor
.PHONY: env
env:
ifndef HOST_URL
$(error HOST_URL is not set)
endif
.PHONY: build
build: dep
gox -output="./release/{{.Dir}}_{{.OS}}_{{.Arch}}" -os="linux windows darwin" -arch="amd64" .
.PHONY: build-local
build-local: dep
go build -o examples/terraform-provider-kafka
.PHONY: create-tag
create-tag: next-tag
git fetch --tags origin
git tag -a v$(TAG) -m "v$(TAG)"
git push origin v$(TAG)
.PHONY: release
release: dep
unset GO111MODULE && curl -sL https://git.io/goreleaser | bash
.PHONY: next-tag
next-tag:
ifndef TAG
$(error TAG is not set)
endif