-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
36 lines (25 loc) · 1.05 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
APIDOC_BASE = cmd/api
APIDOC_INFO = internal/http/handler
MYSQL_URI = mysql://$(MYSQL_USERNAME):$(MYSQL_PASSWORD)@tcp($(MYSQL_HOST):$(MYSQL_PORT))/$(MYSQL_DATABASE_NAME)
include .env
migrate:
migrate create -ext sql -dir database/migration/ -seq $(create)
migrate_up:
migrate -path database/migration -database '$(MYSQL_URI)' -verbose up
migrate_down:
migrate -path database/migration -database '$(MYSQL_URI)' -verbose down
migrate_rollback:
migrate -path database/migration -database '$(MYSQL_URI)' -verbose down $(shell echo ${step}-1 | bc)
migrate_fix:
migrate -path database/migration -database '$(MYSQL_URI)' force $(version)
test:
go test -cover -coverprofile=coverage.out $$(go list ./...)
apidoc:
swag init -d $(APIDOC_BASE),$(APIDOC_INFO) --parseInternal --pd
protob:
protoc --go_out=proto/pb --go_opt=paths=source_relative --go-grpc_out=proto/pb --go-grpc_opt=paths=source_relative proto/*.proto
coverage:
go test ./... -coverprofile cover.out
go tool cover -func cover.out
mock:
mockery --name=$(d) --recursive=true --output=tests/mocks