forked from vmware/nsx-container-plugin-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (30 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
33
34
35
36
37
38
# go options
GO ?= go
LDFLAGS :=
GOFLAGS :=
BINDIR ?= $(CURDIR)/build/bin
GO_FILES := $(shell find . -type d -name '.cache' -prune -o -type f -name '*.go' -print)
GOPATH ?= $$($(GO) env GOPATH)
.PHONY: all
all: build
include versioning.mk
LDFLAGS += $(VERSION_LDFLAGS)
OPERATOR_NAME = nsx-ncp-operator
OPERATOR_IMG_NAME = vmware/nsx-container-plugin-operator
.PHONY: build
build:
GOOS=linux $(GO) build -o $(BINDIR)/$(OPERATOR_NAME) $(GOFLAGS) -ldflags '$(LDFLAGS)' ./cmd/manager
docker build -f build/Dockerfile . -t $(OPERATOR_IMG_NAME):$(DOCKER_IMG_VERSION)
docker tag $(OPERATOR_IMG_NAME):$(DOCKER_IMG_VERSION) $(OPERATOR_IMG_NAME)
.PHONY: bin
bin:
GOOS=linux $(GO) build -o $(BINDIR)/$(OPERATOR_NAME) $(GOFLAGS) -ldflags '$(LDFLAGS)' ./cmd/manager
.PHONY: bundle
bundle:
./bundle/generate_bundle.sh --bundle-repo $(BUNDLE_REPO) --bundle-image $(BUNDLE_IMG_NAME) --bundle-version $(BUNDLE_VERSION)
.PHONY: test-unit
test-unit:
GOOS=linux $(GO) test -race -cover github.com/vmware/nsx-container-plugin-operator/pkg...
.PHONY: clean
clean:
rm -f $(BINDIR)/$(OPERATOR_NAME)