This repository has been archived by the owner on Feb 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile.native
79 lines (56 loc) · 2.33 KB
/
Makefile.native
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
export [email protected]
default: release
local-loaddata:
sed -i 's/\"is_default_site\": true/\"is_default_site\": false/g' publichealth.home.json
python manage.py loaddata publichealth.home.json
migrate:
. /home/app/pyvenv/bin/activate && ./manage.py migrate
migrations:
. /home/app/pyvenv/bin/activate && ./manage.py makemigrations --merge
apply-migrations: migrations migrate
setup:
. /home/app/pyvenv/bin/activate && ./manage.py migrate
. /home/app/pyvenv/bin/activate && ./manage.py createsuperuser --username admin --email $(EMAIL) --noinput
rebuild:
rm -rf node_modules
yarn install
cp -rf node_modules/@bower_components/* /home/app/app/publichealth/static/libs
restart-uwsgi:
sudo /etc/init.d/uwsgi restart
compress:
. /home/app/pyvenv/bin/activate && ./manage.py collectstatic --noinput -i media
. /home/app/pyvenv/bin/activate && ./manage.py compress
release: rebuild compress restart-uwsgi
reindex:
. /home/app/pyvenv/bin/activate && ./manage.py update_index
clear_index:
elasticsearch curl -XDELETE localhost:9200/_all
django-shell:
. /home/app/pyvenv/bin/activate && ./manage.py shell
logs:
tail /var/log/wagtail/publichealth.log /var/log/wagtail/wagtail.log /var/log/wagtail/error.log
backup-data:
. /home/app/pyvenv/bin/activate && ./manage.py dumpdata --natural-foreign -e auth.permission -e contenttypes -e wagtailcore.GroupCollectionPermission -e wagtailcore.GroupPagePermission -e wagtailimages.rendition -e sessions -e feedler.feedlysettings > ~/publichealth.home.json
zip ~/publichealth.home.json.`date +"%d%m%Y-%H%M"`.zip ~/publichealth.home.json
rm ~/publichealth.home.json
backup-images:
echo "Backing up images ..."
sudo chown -R app:app media
zip -ruq ~/media.zip media
backup: backup-data backup-images
loaddata:
. /home/app/pyvenv/bin/activate && ./manage.py loaddata publichealth.home.json
restore: django-loaddata restart
pg-dump:
pg_dump -U app -d publichealth -f ./latest.sql
pg-backup:
pg_dump -U app -d publichealth > ~/pg-backup.sql
zip ~/pg-backup.sql.`date +"%d%m%Y-%H%M"`.zip ~/pg-backup.sql
rm ~/pg-backup.sql
pg-restore:
psql -U app -d publichealth -f ./latest.sql
pg-surefire-drop-restore-db:
# drop existing database, recreate it, and then restore its content from backup.
dropdb -h localhost -U app publichealth
createdb -h localhost -U app publichealth
make pg-restore