-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (46 loc) · 1.1 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
EXEC_DIR=cmd/pulse
BINARY_DIR=${EXEC_DIR}/bin
BINARY_NAME=pulse
DOCKER_IMAGE_NANE=pulse
CONFIG_DIR=./configs
CONFIG_FILE=config.yaml
PORT=8080
.PHONY: build
build:
go build -o ${BINARY_DIR}/${BINARY_NAME} ${EXEC_DIR}/main.go
@cp $(CONFIG_DIR)/$(CONFIG_FILE) $(BINARY_DIR)/
.PHONY: run-benchmark
run-benchmark: build
@cd ${BINARY_DIR} && ./${BINARY_NAME} benchmark
.PHONY: run-analyzer
run-analyzer: build
@cd ${BINARY_DIR} && ./${BINARY_NAME} analyzer
########## DOCKER
.PHONY: docker-build
docker-build:
docker build -t ${DOCKER_IMAGE_NANE} -f build/Dockerfile .
.PHONY: docker-run-benchmark
docker-run-benchmark:
docker run -p ${PORT}:${PORT} ${DOCKER_IMAGE_NANE} benchmark --port=${PORT}
.PHONY: docker-compose-up
docker-compose-up:
docker-compose -f ./build/docker-compose.yml up -d
.PHONY: docker-compose-down
docker-compose-down:
docker-compose -f ./build/docker-compose.yml down
##########
.PHONY: clean
clean:
go clean
.PHONY: test
test:
go test ./...
.PHONY: test_coverage
test_coverage:
go test ./... -coverprofile=coverage.out
.PHONY: dep
dep:
go mod download
.PHONY: vet
vet:
go vet ./...