forked from CenterForOpenScience/SHARE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
up.sh
executable file
·39 lines (33 loc) · 872 Bytes
/
up.sh
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
#!/bin/bash
set -e
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-b|--backup)
BACKUP="sup"
;;
*)
# unknown option
;;
esac
shift # past argument or value
done
#rm -fv ./{*/*/*/,*/*/,}*/migrations/00*.py
#rm -fv ./bots/*/migrations/00*.py
if [ -n "$BACKUP" ]; then
python manage.py dumpdata share.RawData --natural-foreign --natural-primary --format json | gzip > share_rawdata.json.gz
fi
python manage.py celery purge -f
python manage.py reset_db --noinput
python manage.py makemigrations
#git checkout api/migrations
#git checkout share/migrations
#git checkout osf_oauth2_adapter/migrations
#python manage.py maketriggermigrations
#python manage.py makeprovidermigrations
python manage.py migrate
python manage.py loaddata ./share/models/initial_data.yaml
if [ -n "$BACKUP" ]; then
python manage.py loaddata share_rawdata.json.gz
fi