-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (26 loc) · 796 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
.PHONY: init run debug backup clean clean-state clean-cache clean-logs clean-data clean-conversations
init:
conda env create -f environment.yaml
pre-commit install
run: clean-cache
@ENV_FOR_DYNACONF=prod python src/bot.py
debug: clean-state
@ENV_FOR_DYNACONF=dev python src/bot.py
backup:
@timestamp=$$(date +%Y%m%d) && \
mkdir -p backup/$$timestamp && \
cp -r data backup/$$timestamp/. && \
cp -r logs/bot.log backup/$$timestamp/. && \
cp -r backup/$$timestamp/* backup/.
clean: clean-cache clean-logs clean-data
clean-state: clean-cache clean-logs clean-conversations
clean-cache:
@rm -rf src/__pycache__
@rm -rf src/handlers/__pycache__
clean-logs:
@rm -rf logs
clean-data:
@rm -rf data
clean-conversations:
@rm -rf data/db_conversations
@rm -rf data/db_callback_data