forked from jcmoraisjr/haproxy-ingress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (27 loc) · 897 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
.PHONY: default
default: build
GOOS=linux
GOARCH?=amd64
GIT_REPO=$(shell git config --get remote.origin.url)
GIT_COMMIT=git-$(shell git rev-parse --short HEAD)
VERSION_PKG=github.com/jcmoraisjr/haproxy-ingress/pkg/version
.PHONY: build
build:
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build \
-installsuffix cgo \
-ldflags "-s -w -X $(VERSION_PKG).RELEASE=local -X $(VERSION_PKG).COMMIT=$(GIT_COMMIT) -X $(VERSION_PKG).REPO=$(GIT_REPO)" \
-o rootfs/haproxy-ingress-controller pkg/main.go
.PHONY: test
test:
## fix race and add -race param
go test -tags cgo ./...
.PHONY: install
install:
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go install \
-v -installsuffix cgo pkg/main.go
.PHONY: image
image:
docker build -t localhost/haproxy-ingress:latest rootfs
.PHONY: docker-builder
docker-builder:
docker build -t localhost/haproxy-ingress:latest . -f builder/Dockerfile