-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile
46 lines (38 loc) · 1.11 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
IMAGE ?= docker.io/openshift/origin-cluster-svcat-controller-manager-operator
TAG ?= latest
PROG := cluster-svcat-controller-manager-remover
REPO_PATH:= github.com/openshift/cluster-svcat-controller-manager-operator
GO_LD_FLAGS := -ldflags "-X '${REPO_PATH}/pkg/version.SourceGitCommit=$(shell git rev-parse HEAD)'"
GOFLAGS := -mod=vendor
all: build build-image verify
.PHONY: all
build:
GODEBUG=tls13=1 go build ${GO_LD_FLAGS} ./cmd/cluster-svcat-controller-manager-remover
.PHONY: build
image:
docker build -t "$(IMAGE):$(TAG)" .
.PHONY: build-image
test: test-unit test-e2e
.PHONY: test
test-unit:
ifndef JUNITFILE
go test $(GO_LD_FLAGS) -race ./...
else
ifeq (, $(shell which gotest2junit 2>/dev/null))
$(error gotest2junit not found! Get it by `go get -u github.com/openshift/release/tools/gotest2junit`.)
endif
go test $(GO_LD_FLAGS) -race -json ./... | gotest2junit > $(JUNITFILE)
endif
.PHONY: test-unit
test-e2e:
go test -v ./test/e2e/...
.PHONY: test-e2e
verify: verify-govet
hack/verify-gofmt.sh
.PHONY: verify
verify-govet:
go vet $(GO_LD_FLAGS) ./...
.PHONY: verify-govet
clean:
rm -f $(PROG)
.PHONY: clean