-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
35 lines (22 loc) · 802 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
MOD_FLAGS := $(shell (go version | grep -q -E "1\.1[1-9]") && echo -mod=vendor)
CMDS := $(shell go list $(MOD_FLAGS) ./cmd/...)
OUTPUT_DIR := "_output/bin"
IMAGE ?= "docker.io/tohinkashem/graceful:latest"
$(CMDS):
go build $(MOD_FLAGS) -o $(OUTPUT_DIR)/$(shell basename $@) $@
build: clean $(CMDS)
clean:
rm -rf ./_output/bin
mkdir -p ./_output/bin
# go build $(MOD_FLAGS) -o $(BINARY) $(CMD_PACKAGE)
image:
docker build -t $(IMAGE) -f Dockerfile .
docker push $(IMAGE)
prometheus: prometheus-build prometheus-run
prometheus-build:
docker build -t myprometheus -f prometheus/Dockerfile.prometheus .
prometheus-run:
echo "killing prometheus instance" >&2
docker kill prometheus 2>/dev/null || true
docker run --rm -d --network=host --name=prometheus myprometheus
push: build image