-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (31 loc) · 1.25 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
NSQ_COMPONENTS := nsqd nsqlookupd nsqadmin
NSQ_OPERATOR_VERSION := 0.3.0
GOLANG_VERSION := 1.12.4
nsq-images := $(addprefix .image-, ${NSQ_COMPONENTS})
ldflags := $(shell ./hack/version.sh)
PKG_PREFIX := github.com/andyxning/nsq-operator
vet:
go list ./... | grep -v "pkg/sdk/examples" | xargs go vet
fmt:
find . -type f -name "*.go" | grep -v "./vendor/*" | xargs gofmt -s -w -l
test:
go test -timeout=1m -v -race $(shell go list ./... | grep -v "pkg/sdk/examples")
build: clean
CGO_ENABLED=0 go build -ldflags="${ldflags}" -o nsq-operator ${PKG_PREFIX}/cmd/nsq-operator
images: ${nsq-images}
.image-%:
$(MAKE) --no-print-directory -C images $*
nsq-operator-image:
docker run --rm -v "$(shell pwd)":/go/src/${PKG_PREFIX} -w /go/src/${PKG_PREFIX} golang:${GOLANG_VERSION} make build
docker build --no-cache --build-arg GOLANG_VERSION=${GOLANG_VERSION} -t nsq-operator:${NSQ_OPERATOR_VERSION} -f Dockerfile .
reporter: clean
CGO_ENABLED=0 go build -o reporter ${PKG_PREFIX}/cmd/reporter
gen-code:
./hack/update-codegen.sh
update-gen-tool:
./hack/update-codegen-tool.sh
verify-codegen:
./hack/verify-codegen.sh
clean:
rm -f nsq-operator reporter
.PHONY: clean test fmt vet images build gen-code verify-codegen update-gen-tool nsq-operator-image reporter