-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (32 loc) · 831 Bytes
/
Makefile
File metadata and controls
44 lines (32 loc) · 831 Bytes
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
LOCAL_BIN ?= ./bin
version=v1.2.1
container_name=LogWatcher
loglevel=info
config_path=config.yaml
LDFLAGS = "-X 'LogWatcher/pkg/requests.Version=$(version)' -X 'main.ConfigPath=$(config_path)'"
.DEFAULT_GOAL := default
.PHONY: default
default: build run
.PHONY: build
build:
docker build -t condensedtea/logwatcher:latest -t condensedtea/logwatcher:$(version) .
.PHONY: build-local
app e2e
.PHONY: app
app:
CGO_ENABLED=0 go build -ldflags=$(LDFLAGS) -o "$(LOCAL_BIN)/LogWatcher" ./app
.PHONY: e2e
e2e:
CGO_ENABLED=0 go build -o "$(LOCAL_BIN)/TestClient" ./e2e
PHONY: run
run:
docker run --network=host -d --name=$(container_name) condensedtea/logwatcher:latest
PHONY: down
down:
docker kill $(container_name)
PHONY: e2e-test
e2e-test:
./bin/TestClient -log $(E2E_LOG_FILE)
PHONY: test
test:
go test -race ./...