-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (29 loc) · 1.36 KB
/
Makefile
File metadata and controls
37 lines (29 loc) · 1.36 KB
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
BROKERS := $(shell docker port kafka-docker_kafka_1 9092/tcp)
LDFLAGS += -X "github.com/moooofly/hunter-agent/version.GitCommit=$(shell git rev-parse --short HEAD)"
LDFLAGS += -X "github.com/moooofly/hunter-agent/version.Version=$(shell cat VERSION)"
LDFLAGS += -X "github.com/moooofly/hunter-agent/version.BuildTime=$(shell date -u '+%Y-%m-%d %I:%M:%S')"
all:
@echo "Usage:"
@echo " 1. make local"
@echo " 2. make dev"
local: build
@# local env topic: test
./proxy -H tcp://0.0.0.0:12345 -H unix:///var/run/hunter-agent.sock --metrics-addr 0.0.0.0:12346 --broker ${BROKERS} --topic test
dev: build
@# dev env topic: jaeger-spans-test-001
./proxy -H tcp://0.0.0.0:12345 -H unix:///var/run/hunter-agent.sock --metrics-addr 0.0.0.0:12346 --broker 10.1.8.95:9092 --topic jaeger-spans-test-001
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags '$(LDFLAGS)' -o proxy cmd/agent/*.go
@# not support MacOS yet
@#CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o agent.mac cmd/agent/*.go
clean:
rm -f proxy
docker:
docker build -t hunter-agent:$(shell git rev-parse --short HEAD) .
docker_run:
docker run -it -p 12345:12345 -v /var/run:/var/run --rm hunter-agent:$(shell git rev-parse --short HEAD) \
-H tcp://0.0.0.0:12345 \
-H unix:///var/run/hunter-agent.sock \
--metrics-addr 0.0.0.0:12346 \
--broker 10.1.8.95:9092 \
--topic jaeger-spans-test-001