-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (34 loc) · 1.18 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
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(RUN_ARGS):;@:)
BACKUPS_PATH := ./data/backups/postgres
run:
docker-compose up -d --force-recreate
build:
docker-compose build --no-cache
psql:
docker-compose exec postgres psql -U postgres postgres
pg_dump:
mkdir -p ./data/backups/postgres && docker-compose exec -T postgres pg_dump -U postgres postgres --no-owner \
| gzip -9 > ./data/backups/postgres/backup-$(shell date +%Y-%m-%d_%H-%M-%S).sql.gz
pg_restore:
mkdir -p ./data/backups/postgres && bash ./bin/pg_restore.sh ${BACKUPS_PATH}
exec:
docker-compose exec bot /bin/bash
logs:
docker-compose logs -f bot
restart:
docker-compose restart bot
stop:
docker-compose stop
db_revision:
docker-compose exec bot alembic revision --autogenerate ${RUN_ARGS}
db_upgrade:
docker-compose exec bot alembic upgrade head
pybabel_extract:
pybabel extract --input-dirs=. -o ./data/locales/bot.pot --project=bot
pybabel_init:
pybabel init -i ./data/locales/bot.pot -d ./data/locales -D bot -l ${RUN_ARGS}
pybabel_compile:
pybabel compile -d ./data/locales -D bot --statistics
pybabel_update:
pybabel update -i ./data/locales/bot.pot -d ./data/locales -D bot