-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (41 loc) · 1.99 KB
/
Makefile
File metadata and controls
54 lines (41 loc) · 1.99 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
PROTO_AUTH_DIR := api/auth
PROTO_AUTH_FILE := $(PROTO_AUTH_DIR)/auth.proto
PROTO_USERS_DIR := api/users
PROTO_USERS_FILE := $(PROTO_USERS_DIR)/users.proto
GHZ_DATA_DIR := internal/pkg/ghz
generate-proto:
protoc -I $(PROTO_AUTH_DIR) --go-grpc_out=. --go_out=. $(PROTO_AUTH_FILE)
protoc -I $(PROTO_USERS_DIR) --go-grpc_out=. --go_out=. $(PROTO_USERS_FILE)
make-migrations:
atlas migrate diff --env gorm
migrate:
atlas migrate apply --env gorm
run:
go run cmd/auth/main.go
run-test:
@echo "Using CONFIG_PATH=/config/local.test.yml"
@CONFIG_PATH=$(PWD)/config/local.test.yml go run cmd/auth/main.go
run-prod:
@echo "Using CONFIG_PATH=/config/prod.yml"
@docker-compose -f docker-compose.prod.yml up -d --build
test:
@echo "Using CONFIG_PATH=/config/local.test.yml"
@CONFIG_PATH=$(PWD)/config/local.test.yml go test -v -count=1 -p 1 ./tests/auth/... ./tests/users/...
docker-test:
@echo "Using CONFIG_PATH=/config/prod.yml"
@CONFIG_PATH=$(PWD)/config/prod.yml go test -v -count=1 -p 1 ./tests/auth/... ./tests/users/...
load-test:
@export PATH=$PATH:$(go env GOPATH)/bin
@echo "Starting auth.Auth.Register DDOS..."
@ghz --insecure --proto ./$(PROTO_AUTH_FILE) --call auth.Auth.Register -n 1000 -c 5 --data-file ./$(GHZ_DATA_DIR)/register.json localhost:9090
@echo "Starting auth.Auth.RegenerateCode DDOS..."
@ghz --insecure --proto ./$(PROTO_AUTH_FILE) --call auth.Auth.RegenerateCode -n 1000 -c 5 --data-file ./$(GHZ_DATA_DIR)/regenerate_code.json localhost:9090
@go run cmd/drop_users/main.go
docker-load-test:
@export PATH=$PATH:$(go env GOPATH)/bin
@echo "Starting auth.Auth.Register DDOS..."
@ghz --insecure --proto ./$(PROTO_AUTH_FILE) --call auth.Auth.Register -n 1000 -c 5 --data-file ./$(GHZ_DATA_DIR)/register.json localhost:50051
@echo "Starting auth.Auth.RegenerateCode DDOS..."
@ghz --insecure --proto ./$(PROTO_AUTH_FILE) --call auth.Auth.RegenerateCode -n 1000 -c 5 --data-file ./$(GHZ_DATA_DIR)/regenerate_code.json localhost:50051
@go run cmd/drop_users/main.go
.PHONY: generate, test