This repository has been archived by the owner on Jul 22, 2023. It is now read-only.
forked from CodeTheChangeUBC/reBOOT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
92 lines (75 loc) · 1.6 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
SHELL=./make-venv
export RABBITMQ_CONFIG_FILE=rabbitmq.conf
all: env static server
# List all commands
.PHONY: ls
ls:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
.PHONY: shell
shell:
python3 manage.py shell
.PHONY: heroku
heroku:
heroku local
.PHONY: install
install:
sh scripts/start_db.sh
sh scripts/create_db.sh
python3 -m venv venv
make post-install
.PHONY: post-install
post-install:
pip install -U pip
pip install -r requirements.txt
make migrate
make groups
make static
make stopenv
.PHONY: static
static:
python3 manage.py collectstatic -c --no-input
.PHONY: server
server:
python3 manage.py runserver
.PHONY: env
env:
sh scripts/start_db.sh
ifeq ($(USER),vscode)
sudo rabbitmq-server -detached
else
rabbitmq-server -detached
endif
@echo "RabbitMQ Status: Online"
.PHONY: stopenv
stopenv:
ifeq ($(USER),vscode)
sudo rabbitmqctl stop --idempotent
else
rabbitmqctl stop --idempotent
endif
@echo "RabbitMQ Status: Offline"
sh scripts/stop_db.sh
.PHONY: migrate
migrate:
python3 manage.py makemigrations
python3 manage.py migrate
.PHONY: celery
celery:
celery worker -A reboot --without-gossip --without-heartbeat
.PHONY: clean
clean:
rm -rf venv
rm -rf staticfiles
.PHONY: groups
groups:
python3 manage.py creategroups
.PHONY: codespace
codespace:
initdb /usr/local/var/postgres
make .env
make .git/hooks/pre-commit
make install
.env:
cp .env.sample .env
.git/hooks/pre-commit:
cp hooks/pre-commit .git/hooks/pre-commit