-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
124 lines (70 loc) · 2.81 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
DUMP=database.dump
run:
docker-compose run --rm --service-ports django
run-without-django:
docker-compose up node db
clean:
-rm -rf node_modules
-rm -rf .venv
###############################################################################
### Project initialization
###############################################################################
make-migrations:
docker-compose run --rm django python manage.py makemigrations
migrate:
docker-compose run --rm django python manage.py migrate
create-user:
docker-compose run --rm django \
bash -c "echo \"from django.contrib.auth import get_user_model; \
get_user_model().objects.create_superuser('admin', 'admin@example.com', 'admin')\" \
| python manage.py shell"
init: make-migrations migrate create-user
dropdb:
docker-compose run --rm psql dropdb docker
createdb:
docker-compose run --rm psql createdb docker
resetdb: dropdb createdb
pg_restore: resetdb
docker-compose run --rm --volume=`pwd`:/dump psql pg_restore --dbname=docker --no-owner /dump/$(DUMP)
###############################################################################
### Update dependencies
###############################################################################
front-update-dependencies:
docker-compose run --rm node npm install --no-audit
back-update-dependencies:
docker-compose build django
update-dependencies: front-update-dependencies back-update-dependencies
###############################################################################
### Container access
###############################################################################
node:
docker-compose run --rm node bash
postgres:
docker-compose run --rm psql
django:
docker-compose run --rm django python manage.py shell
###############################################################################
### Testing
###############################################################################
front-test:
docker-compose run --rm node npm test
back-test:
docker-compose run --rm django python manage.py test
test: front-test back-test
###############################################################################
### Linting
###############################################################################
front-lint:
docker-compose run --rm --no-deps node npm run lint
back-lint:
docker-compose run --rm --no-deps django python -m flake8
lint: front-lint back-lint
###############################################################################
### Translations
###############################################################################
translate-ca:
docker-compose run --rm django python manage.py makemessages -l 'ca'
translate-es:
docker-compose run --rm django python manage.py makemessages -l 'es'
compile-translations:
docker-compose run --rm django python manage.py compilemessages