-
Notifications
You must be signed in to change notification settings - Fork 67
/
Makefile
73 lines (56 loc) · 1.21 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
.PHONY: all
all: update migrate
.PHONY: run
run:
python manage.py runserver
.PHONY: serve
serve:
python manage.py runserver 0.0.0.0:8000
.PHONY: update
update:
pip install --upgrade -r requirements.txt
npm install
.PHONY: migrate
migrate:
python manage.py migrate
.PHONY: migrations
migrations:
python manage.py makemigrations
.PHONY: lint
lint: lint-python lint-js-fix
.PHONY: lint-python
lint-python:
flake8 dwitter/ --exclude=migrations,settings
.PHONY: lint-js
lint-js:
npm run lint -- --max-warnings 0
.PHONY: lint-js-fix
lint-js-fix:
npm run lint-fix -- --max-warnings 0
.PHONY: lint-css-fix
lint-css-fix:
npm run css-fix
.PHONY: test
test:
python manage.py test
.PHONY: check_setup
check_setup:
@echo -n "Are you sure? This will overwrite your local.py settings file [y/N] " && read ans && [ $${ans:-N} = y ]
.PHONY: setup
setup: check_setup
virtualenv venv
cp dwitter/settings/local.py.example dwitter/settings/local.py
.PHONY: shell
shell:
python manage.py shell
.PHONY: backup
backup:
python manage.py dbbackup
.PHONY: restore-backup
restore-backup:
python manage.py dbrestore
.PHONY: clean
clean:
find . -name '*.pyc' -delete
find . -name '__pycache__' -delete
find . -type d -empty -delete