forked from stakater/IngressMonitorController
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (42 loc) · 1.38 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# note: call scripts from /scripts
.PHONY: default build builder-image binary-image test stop clean-images clean push apply deploy helm-template helm-install
BUILDER ?= ingressmonitorcontroller-builder
BINARY ?= IngressMonitorController
DOCKER_IMAGE ?= stakater/ingressmonitorcontroller
# Default value "dev"
DOCKER_TAG ?= dev
REPOSITORY = ${DOCKER_IMAGE}:${DOCKER_TAG}
VERSION=$(shell cat .version)
BUILD=
GOCMD = go
GOFLAGS ?= $(GOFLAGS:)
LDFLAGS =
HELMPATH= deployments/kubernetes/chart/ingressmonitorcontroller
HELMVALUES = $(HELMPATH)/values.yaml
HELMNAME = IMC
default: build test
install:
"$(GOCMD)" mod download
build:
"$(GOCMD)" build ${GOFLAGS} ${LDFLAGS} -o "${BINARY}"
builder-image:
@docker build --network host -t "${BUILDER}" -f build/package/Dockerfile.build .
binary-image: builder-image
@docker run --network host --rm "${BUILDER}" | docker build --network host -t "${REPOSITORY}" -f Dockerfile.run -
test:
"$(GOCMD)" test -v ./...
stop:
@docker stop "${BINARY}"
clean-images: stop
@docker rmi "${BUILDER}" "${BINARY}"
clean:
"$(GOCMD)" clean -i
push: ## push the latest Docker image to DockerHub
docker push $(REPOSITORY)
apply:
kubectl apply -f deployments/manifests/
deploy: binary-image push apply
helm-template:
helm template $(HELMPATH) --values $(HELMVALUES) --name $(HELMNAME)
helm-install:
helm install $(HELMPATH) --values $(HELMVALUES) --name $(HELMNAME)