-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
66 lines (55 loc) · 2.19 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
.PHONY: clean_local_microservices
clean_local_microservices:
sudo kill -9 $(sudo lsof -t -i:9000) &
sudo kill -9 $(sudo lsof -t -i:9001) &
sudo kill -9 $(sudo lsof -t -i:9002) &
sudo kill -9 $(sudo lsof -t -i:9003) &
sudo kill -9 $(sudo lsof -t -i:9004) &
sudo kill -9 $(sudo lsof -t -i:9005) &
sudo kill -9 $(sudo lsof -t -i:8081) &
.PHONY: run_local_microservices
run_local_microservices:
go run cmd/consumer/rabbitMQ/main.go >> logs/consumer 2>&1 &
go run cmd/producer/rabbitMQ/main.go >> logs/producer 2>&1 &
go run cmd/auth/main.go >> logs/auth 2>&1 &
go run cmd/chat/main.go >> logs/chat 2>&1 &
go run cmd/messages/main.go >> logs/messages 2>&1 &
go run cmd/user/main.go >> logs/user 2>&1 &
go run cmd/api/main.go >> logs/api 2>&1 &
.PHONY: run_stack
run_stack:
cd docker && docker compose -f docker-compose-stack.yml up -d
.PHONY: run_prod
run_prod:
cd docker && docker compose -f docker-compose-prod.yml up -d
.PHONY: stop_prod
stop_prod:
cd docker && docker compose -f docker-compose-prod.yml down
.PHONY: run_sentry
run_sentry: |
cd docker && docker compose -f docker-compose-stack.yml run --rm sentry-base config generate-secret-key
cd docker && docker compose -f docker-compose-stack.yml run --rm sentry-base upgrade
.PHONY: clean_images_containers
clean_images_containers: |
docker stop $(docker ps -q)
docker system prune -a
.PHONY: generate_proto_rpc
generate_proto_rpc: |
protoc --go-grpc_opt=require_unimplemented_servers=false --go-grpc_out=internal/generated protobuf/*_rpc.proto
.PHONY: generate_proto
generate_proto: |
find protobuf -type f -name '*.proto' ! -name '*_rpc.proto' -exec protoc --go_out=internal/generated {} +
.PHONY: cover_out
cover_out: |
go test -coverprofile=c.out ./... -coverpkg=./...
cat c.out | grep -v "cmd" | grep -v "_mock.go" | grep -v ".pb" | grep -v "_easyjson.go" > tmp.out
go tool cover -func=tmp.out
.PHONY: cover_html
cover_html: |
go test -v ./... -coverprofile=c.out ./... -coverpkg=./...
cat c.out | grep -v "cmd" | grep -v "_mock.go" | grep -v ".pb" | grep -v "_easyjson.go" > tmp.out
go tool cover -html=tmp.out
.PHONY: pgbadger
pgbadger: |
sudo apt-get install pgbadger || true
pgbadger /var/log/postgresql/*.json -o logs/pgbadger/report.html