-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
67 lines (55 loc) · 1.64 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
SHELL := /bin/bash
.PHONY: clean
clean:
@-rm agent-app
@-rm monitor-app
## build-sever:
.PHONY: build-fe
build-fe:
@-rm -r build
$(MAKE) -C ./monitor-fe all
mkdir build && cp -r ./monitor-fe/dist build
.PHONY: build-agent
build-agent:
GOOS=linux go build -o agent-app agent.go
.PHONY: build-monitor
build-monitor: | build-fe
GOOS=linux go build -o monitor-app monitor.go
## go-test: go unit test
.PHONY: go-test
go-test:
go test -v ./... -race -coverprofile=coverage.txt -covermode=atomic
.PHONY: services-start
services-start:
docker-compose -f test/docker-compose.yml up -d
.PHONY: services-down
services-down:
docker-compose -f test/docker-compose.yml down
.PHONY: file-file-test
file-file-test: build
timeout --preserve-status 20s ./main -c test/file-file-test.yml
@sh test/check-same-line.sh test/input-test.txt output-test.txt
@rm output-test.txt
.PHONY: kafka-test
kafka-test: build
$(MAKE) services-start
sleep 10s
timeout --preserve-status 20s ./main -c test/file-kafka-test.yml
timeout --preserve-status 20s ./main -c test/kafka-file-test.yml
@sh test/check-same-line.sh test/input-test.txt output-test.txt
$(MAKE) services-down
rm output-test.txt
.PHONY: docker-push-agent
docker-push-agent: | build-agent
docker build --tag agent -f Dockerfile.agent .
docker tag agent formatter/agent:$(docker_version)
docker push formatter/agent
.PHONY: docker-push-monitor
docker-push-monitor: | build-monitor
docker build --tag monitor -f Dockerfile.monitor .
docker tag monitor formatter/monitor:$(docker_version)
docker push formatter/monitor
.PHONY: docker-push-all
docker-push-all:
$(MAKE) docker-push-agent
$(MAKE) docker-push-monitor