-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (27 loc) · 1.04 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
include $(PWD)/.env
DB_URL = mysql://$(DB_USER):$(DB_PASS)@tcp($(DB_HOST):$(DB_PORT))/$(DB_NAME)
TEST_DB_URL = mysql://$(DB_USER):$(DB_PASS)@tcp($(DB_HOST):$(DB_PORT))/$(DB_TEST_NAME)
run:
cd cmd; go run main.go
build:
cd cmd; go build
build_run:
cd cmd; go build; ./cmd
run_test:
go test -v -cover ./repository/...; go test -v -cover ./service/...; go test -v -cover ./controller/...
migrateup:
migrate -path db/migrations -database "$(DB_URL)" -verbose up
migrateup1:
migrate -path db/migrations -database "$(DB_URL)" -verbose up 1
migratedown:
migrate -path db/migrations -database "$(DB_URL)" -verbose down
migratedown1:
migrate -path db/migrations -database "$(DB_URL)" -verbose down 1
migrateup_test:
migrate -path db/migrations -database "$(TEST_DB_URL)" -verbose up
migrateup1_test:
migrate -path db/migrations -database "$(TEST_DB_URL)" -verbose up 1
migratedown_test:
migrate -path db/migrations -database "$(TEST_DB_URL)" -verbose down
migratedown1_test:
migrate -path db/migrations -database "$(TEST_DB_URL)" -verbose down 1