-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (42 loc) · 1.23 KB
/
Copy pathMakefile
File metadata and controls
57 lines (42 loc) · 1.23 KB
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
APP_NAME = rida
RIDA_API_KEY ?= demo-api-key
RIDA_OTTAWA_CLIENTS ?= 1
RIDA_MONTREAL_CLIENTS ?= 2
RIDA_HTTP_PORT ?= :8080
.PHONY: all build run run-race test lint format check install-hooks run-docker stop-docker test-docker
all: build
build:
go build -o bin/rida .
run: build
./bin/$(APP_NAME) \
-api-key=$(RIDA_API_KEY) \
-ottawa-clients=$(RIDA_OTTAWA_CLIENTS) \
-montreal-clients=$(RIDA_MONTREAL_CLIENTS) \
-http-port=$(RIDA_HTTP_PORT)
run-race:
go run -race main.go \
-api-key=$(RIDA_API_KEY) \
-ottawa-clients=$(RIDA_OTTAWA_CLIENTS) \
-montreal-clients=$(RIDA_MONTREAL_CLIENTS) \
-http-port=$(RIDA_HTTP_PORT)
test:
go test ./...
test-race:
go test -race ./...
lint:
golangci-lint run ./...
format:
go fmt ./...
check: format lint
install-hooks:
ln -sf scripts/hooks/pre-commit .git/hooks/pre-commit
chmod +x scripts/hooks/pre-commit
run-docker:
docker-compose -f deployment/docker-compose.yml up --build
stop-docker:
docker-compose -f deployment/docker-compose.yml down
test-docker:
docker-compose -f deployment/docker-compose.yml up -d --build
sleep 3
curl --fail http://localhost:8080/healthz || (echo "\n[ERROR] The app did not respond in Docker" && exit 1)
docker-compose -f deployment/docker-compose.yml down