-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
58 lines (43 loc) · 1.65 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
VENV_NAME = venv
VENV_ACTIVATE_PATH = $(VENV_NAME)/bin/activate
PROJECT_DIR = harc_game_web
venv:
python3 -m virtualenv ./$(VENV_NAME)
. ./$(VENV_ACTIVATE_PATH) && \
python3 -m pip install -r requirements.txt
migrate: venv
. ./$(VENV_ACTIVATE_PATH) && \
python3 $(PROJECT_DIR)/manage.py makemigrations && \
python3 $(PROJECT_DIR)/manage.py migrate
dev-populate-db-examples: venv
. ./$(VENV_ACTIVATE_PATH) && \
python3 $(PROJECT_DIR)/manage.py loaddata example_db.json --app teams && \
python3 $(PROJECT_DIR)/manage.py loaddata example_db.json --app users && \
python3 $(PROJECT_DIR)/manage.py loaddata example_db.json --exclude teams --exclude users
dev-prepare: migrate dev-populate-db-examples
prd-populate-db:
. ./$(VENV_ACTIVATE_PATH) && \
python3 $(PROJECT_DIR)/manage.py loaddata base_db.json
populate-db: venv
. ./$(VENV_ACTIVATE_PATH) && \
python3 utils/convert_tasks.py $(PROJECT_DIR)/apps/tasks/fixtures/base_db.csv && \
python3 utils/convert_passwords.py $(PROJECT_DIR)/apps/wotd/fixtures/base_db.csv && \
python3 $(PROJECT_DIR)/manage.py loaddata base_db.json
prepare: migrate populate-db
prd-prepare: migrate prd-populate-db
run: venv
. ./$(VENV_ACTIVATE_PATH) && \
python3 $(PROJECT_DIR)/manage.py runserver 0.0.0.0:8000
test: venv
. ./$(VENV_ACTIVATE_PATH) && \
python3 $(PROJECT_DIR)/manage.py test harc_game_web
shell: venv
. ./$(VENV_ACTIVATE_PATH) && \
python3 $(PROJECT_DIR)/manage.py shell
clean-media:
rm -rf $(PROJECT_DIR)/media/
clean-migrations:
find harc_game_web/ -type f | grep migrations | (grep -v __init__.py || echo :) | xargs rm
clean-db:
rm -f $(PROJECT_DIR)/db.sqlite3
clean: clean-media clean-migrations clean-db