This repository has been archived by the owner on Dec 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·49 lines (48 loc) · 1.69 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
# This isn't a traditional Makefile for compiling an application, it just serves as a shortcut for some commonly-needed development commands like dumping and reloading the database, running tests, etc.
all:
docker-compose up
detached:
docker-compose up -d
stop:
docker-compose stop rest
down:
docker-compose down
serve:
cd vue; npm run serve
attach:
docker-compose exec rest bash
db:
docker-compose exec postgres psql -U app -d campi
restart:
docker-compose restart rest nginx
check:
docker-compose exec rest python manage.py check
shell:
docker-compose exec rest python manage.py shell
build:
docker-compose build
rebuild:
docker-compose build --no-cache rest
test:
docker-compose exec rest python manage.py test
blank: stop
docker-compose exec postgres psql -U app -d postgres -c 'DROP DATABASE campi;'
wipe: blank
docker-compose exec postgres psql -U app -d postgres -c 'CREATE DATABASE campi;'
$(MAKE) restart
migrate: wipe
docker-compose exec rest python manage.py migrate
dumpusers:
docker-compose exec rest python manage.py dumpdata --indent 2 auth authtoken -e auth.permission -o /vol/data/users.json
restoreusers:
docker-compose exec rest python manage.py loaddata /vol/data/users.json
backup:
docker-compose exec postgres pg_dump -U app -d campi > data/bkp/bk.sql
restore: wipe
docker-compose exec -T postgres psql -U app -d campi < data/bkp/bk.sql
resetmigrations:
find rest -type f -regex ".*/migrations/[0-9].*" -exec rm {} \;
dumptest:
docker-compose exec rest python manage.py dumpdata --indent 2 -e silk -e sessions -e contenttypes -e auth.permission -e auth.group -o campi/fixtures/test.json
loadtest: migrate
docker-compose exec rest python manage.py loaddata campi/fixtures/test.json