-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (44 loc) · 1.57 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
all: start
start: bins
@docker compose --file ./docker/docker-compose.yaml up
start-detached: bins
@docker compose --file ./docker/docker-compose.yaml up -d
bins:
@GO111MODULE=on go build .
restart:
@docker compose --file ./docker/docker-compose.yaml restart
down:
@docker compose --file ./docker/docker-compose.yaml down
clean: down
@docker image rm docker_tutor
@GO111MODULE=on go clean -x
logs:
@docker compose --file ./docker/docker-compose.yaml logs
local: export SERVER_HOST=0.0.0.0
local: export SERVER_PORT=8000
local: export DB_HOST=0.0.0.0
local: export DB_PORT=3306
local: export DB_USER=web_app
local: export DB_PASSWORD=web_app_password
local: export DB_PARSE_TIME=true
local: export DB_CHARSET=utf8mb4
local: export DB_NAME=tutor
local: export REPORTING_HOST=127.0.0.1
local: export REPORTING_PORT=8125
local: export REPORTING_MAX_FLUSH_INTERVAL=150
local: export REPORTING_MAX_FLUSH_BYTES=512
local: bins
@docker compose --file ./docker/docker-compose.debug.yaml up -d
# ./tutor
nvim main.go
debug: bins
@docker compose --file ./docker/docker-compose.debug.yaml up -d
debug-db: debug
@docker compose --file docker/docker-compose.debug.yaml exec tutor-db mysql --user web_app --password tutor
migration: export GOOSE_MIGRATION_DIR=./infrastructure/migrations
migration:
@goose create $(GOOSE_MIGRATION_NAME) sql
migrate:
@goose -dir infrastructure/migrations mysql "web_app:web_app_password@tcp(0.0.0.0:3306)/tutor?parseTime=true" up
rollback:
@goose -dir infrastructure/migrations mysql "web_app:web_app_password@tcp(0.0.0.0:3306)/tutor?parseTime=true" down