forked from kuskoman/logstash-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (32 loc) · 866 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
GOOS_VALUES := linux darwin windows
GOOS_BINARIES := $(foreach goos,$(GOOS_VALUES),out/main-$(goos))
GOOS_EXES := $(foreach goos,$(GOOS_VALUES),$(if $(filter windows,$(goos)),out/main-$(goos),out/main-$(goos)))
all: $(GOOS_BINARIES)
out/main-%:
CGO_ENABLED=0 GOOS=$* go build -a -installsuffix cgo -ldflags="-w -s" -o out/main-$* cmd/exporter/main.go
run:
go run cmd/exporter/main.go
build-linux: out/main-linux
build-darwin: out/main-darwin
build-windows: out/main-windows
build-docker:
docker build -t logstash-exporter .
clean:
rm -f $(GOOS_EXES)
test:
go test -v ./...
compose:
docker-compose up -d --build
wait-for-compose:
docker-compose up -d --wait
compose-down:
docker-compose down
verify-metrics:
./scripts/verify-metrics.sh
pull:
docker-compose pull
logs:
docker-compose logs -f
minify:
upx -9 $(GOOS_EXES)
.DEFAULT_GOAL := run