forked from jcmoraisjr/haproxy-ingress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (26 loc) · 802 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
.PHONY: default
default: build
REPO_LOCAL=localhost/haproxy-ingress
REPO_PUBLIC=quay.io/jcmoraisjr/haproxy-ingress
DOCKER_HUB=quay.io
include container.mk
GOOS=linux
GOARCH=amd64
GIT_REPO=$(shell git config --get remote.origin.url)
ROOT_PKG=github.com/jcmoraisjr/haproxy-ingress/pkg
.PHONY: build
build:
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build \
-installsuffix cgo \
-ldflags "-s -w -X $(ROOT_PKG)/version.RELEASE=$(TAG) -X $(ROOT_PKG)/version.COMMIT=$(GIT_COMMIT) -X $(ROOT_PKG)/version.REPO=$(GIT_REPO)" \
-o rootfs/haproxy-ingress-controller \
$(ROOT_PKG)
.PHONY: test
test:
## fix race and add -race param
go test -tags cgo $(ROOT_PKG)/...
.PHONY: install
install:
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go install \
-v -installsuffix cgo \
$(ROOT_PKG)