-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (42 loc) · 1.68 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
60
61
62
63
MAKEFLAGS += --silent
# ----- config ----- #
ENV_FILE=.env
CONFIRM=confirm
# -- dependencies -- #
include mkfile/Makefile.function
include mkfile/Makefile.style
include $(ENV_FILE)
# ----- Basic ----- #
build: ## Build App
@export ACTION="BUILD " APP="$(APP_NAME).app" && make .cmd-info
@docker compose --env-file $(ENV_FILE) build
up: ## Up App
@export ACTION="UP " APP="$(APP_NAME).app" && make .cmd-info
@docker compose --env-file $(ENV_FILE) up -d app
down: ## Down App
@export ACTION="DOWN " APP="$(APP_NAME).app" && make .cmd-info
@docker compose --env-file $(ENV_FILE) rm -sf app
run: ## Execute App with $bash
@clear
@export ACTION="EXECUTE " APP="$(APP_NAME).app" && make .cmd-info
@docker exec -it "$(APP_NAME)" bash
# ----- Advanced ----- #
launch: up-redis ## Launch Services
@export ACTION="LAUNCHED " APP="services" && make .cmd-info
close: down-redis ## Close Services
@export ACTION="CLOSED " APP="services" && make .cmd-info
re: down up ## Recreate App
@export ACTION="RECREATED " APP="$(APP_NAME).app" && make .cmd-info
uu: launch up ## Launch Services & Up App
dd: down close ## Down App & Close Services
restart: dd uu ## Restart Services & App
@export ACTION="RESTARTED " APP="services & app" && make .cmd-info
uur: uu run ## Launch Services & Up App & Execute App
rr: re run ## Restart App & Execute App
# ----- Optional ----- #
up-redis: ## Up redis
@export ACTION="UP " APP="$(APP_NAME).redis" && make .cmd-info
@docker compose --env-file $(ENV_FILE) up -d redis
down-redis: ## Down redis
@export ACTION="DOWN " APP="$(APP_NAME).redis" && make .cmd-info
@docker compose --env-file $(ENV_FILE) rm -sf redis