forked from dsmrreader/dsmr-reader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost-deploy.sh
executable file
·57 lines (41 loc) · 1.13 KB
/
post-deploy.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
echo ""
echo ""
echo " --- Checking whether VirtualEnv is activated."
python -c 'import sys; exit_code = 0 if hasattr(sys, "real_prefix") else 1; sys.exit(exit_code);'
if [ $? -ne 0 ]; then
echo " [i] ----- Activating 'dsmrreader' VirtualEnv..."
source ~/.virtualenvs/dsmrreader/bin/activate
if [ $? -ne 0 ]; then
echo " [!] FAILED to switch to 'dsmrreader' VirtualEnv (is it installed?)"
exit 1;
fi
fi
echo ""
echo ""
echo " --- Checking Python version."
./check_python_version.py
if [ $? -ne 0 ]; then
echo "[!] Aborting post-deployment"
exit 1;
fi
echo ""
echo ""
echo " --- Checking & synchronizing base requirements for changes."
pip3 install -r dsmrreader/provisioning/requirements/base.txt --upgrade
echo ""
echo ""
echo " --- Checking & synchronizing database changes/migrations."
./manage.py migrate --noinput
echo ""
echo ""
echo " --- Checking & synchronizing static file changes."
./manage.py collectstatic --noinput
echo ""
echo ""
echo " --- Reloading running apps..."
./reload.sh
echo ""
echo ""
echo " --- Clearing cache..."
./manage.py dsmr_frontend_clear_cache