-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
100 lines (77 loc) · 1.76 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
.PHONY: all
all: ps ;
.PHONY: up
up: var/ _storage/ _share
docker-compose up -d
.PHONY: down
down:
docker-compose down
.PHONY: reload
reload:
$(MAKE) down
$(MAKE) up
.PHONY: restart
restart: var/ _storage/
docker-compose restart
.PHONY: build
build:
docker pull node:22-alpine
docker-compose build
.PHONY: pull
pull:
docker-compose pull
.PHONY: log
log:
docker-compose logs -f --tail 0
.PHONY: ps
ps:
docker-compose ps
.PHONY: top
top:
docker-compose top
.PHONY: chown
chown:
sudo chown "$(shell id -g):$(shell id -u)" * -Rf
.PHONY: backup
backup:
sudo bash _scripts/backup.sh $(shell id -g) $(shell id -u) var _storage
var/ _storage/ _share:
mkdir -p "$@"
# -----------------------------------------------------------------------------
# DB
# -----------------------------------------------------------------------------
.PHONY: db-cli
db-cli:
bash db/cli
.PHONY: migrate
db-migrate:
bash db/flyway migrate
.PHONY: dump
db-dump:
bash db/dump
.PHONY: gear-cli
gear-cli:
docker-compose exec 'the-gear-of-seasons' bash
# -----------------------------------------------------------------------------
# batch
# -----------------------------------------------------------------------------
.PHONY: gear-cli
gear-gc:
docker-compose run --rm \
'the-gear-of-seasons' \
'/app/server/dist/cmd/gc.js'
.PHONY: gear-cli
gear-regenerate:
docker-compose run --rm \
'the-gear-of-seasons' \
'/app/server/dist/cmd/regenerate-cache.js'
.PHONY: gear-heapdump
gear-heapdump:
docker-compose kill -s SIGUSR1 'the-gear-of-seasons'
# -----------------------------------------------------------------------------
# npm
# -----------------------------------------------------------------------------
.PHONY: upgrade
upgrade:
cd client && npm run up
cd server && npm run up