-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (31 loc) · 918 Bytes
/
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
ENV := $(if $(ENV),$(ENV),local)
BINARIES_DIR := cmd
SERVICES_LIST := $(shell find $(BINARIES_DIR) -maxdepth 1 \( ! -iname "$(BINARIES_DIR)" \) -type d -exec basename {} \;)
SERVICES_RUN_TARGETS_LIST := $(addprefix run-, $(SERVICES_LIST))
mod:
go mod tidy
vendor:
go mod vendor
update: mod vendor
install-migrator:
go get -v github.com/rubenv/sql-migrate/...
migrate-status:
ENV=$(ENV) ./migrations/runner.sh status
migrate-up:
ENV=$(ENV) ./migrations/runner.sh up
migrate-down:
ENV=$(ENV) ./migrations/runner.sh down
migrate-reports-down:
ENV=$(ENV) ./migrations/dealer-reports/runner.sh down
migrate-up-down-up:
ENV=$(ENV) ./migrations/runner.sh up-down-up
env-start:
./docker/env.sh start
env-restart:
./docker/env.sh restart
env-stop:
./docker/env.sh stop
setup-env: install-migrator update migrate-up env-start
$(SERVICES_RUN_TARGETS_LIST): run-%:
./docker/env.sh start
go run ./cmd/$*