-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
30 lines (23 loc) · 898 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
CURDIR=$(shell pwd)
CLUSTER_IP=$(shell kubectl -n kubearmor get svc | grep kafka-bootstrap | awk '{print $$3}')
KAFKA_BOOTSTRAP_SERVER=$(CLUSTER_IP):9092
TOPIC_MSG=kubearmor-messages
TOPIC_ALERT=kubearmor-alerts
TOPIC_LOG=kubearmor-syslogs
.PHONY: build
build:
cd $(CURDIR); go mod tidy
cd $(CURDIR); go build -o kubearmor-kafka-client main.go
.PHONY: run
run: $(CURDIR)/kubearmor-kafka-client
cd $(CURDIR); KAFKA_BOOTSTRAP_SERVER=$(KAFKA_BOOTSTRAP_SERVER) TOPIC_MSG=$(TOPIC_MSG) TOPIC_ALERT=$(TOPIC_ALERT) TOPIC_LOG=$(TOPIC_LOG) ./kubearmor-kafka-client
.PHONY: build-image
build-image:
cd $(CURDIR); docker build -t kubearmor/kubearmor-kafka-client:latest .
.PHONY: push-image
push-image:
cd $(CURDIR); docker push kubearmor/kubearmor-kafka-client:latest
.PHONY: clean
clean:
cd $(CURDIR); sudo rm -f kubearmor-kafka-client
#cd $(CURDIR); find . -name go.sum | xargs -I {} rm -f {}