-
Notifications
You must be signed in to change notification settings - Fork 24
/
start.sh
executable file
·61 lines (50 loc) · 1.1 KB
/
start.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
58
59
60
61
#!/bin/bash
venv=~/.venvs/venvdrfpipeline
env_name=dev
if [[ "${USE_ENV}" != "" ]]; then
env_name="${USE_ENV}"
fi
if [[ ! -e ./envs/${env_name}.env ]]; then
echo ""
echo "Failed to find env file: envs/${env_name}.env"
echo ""
exit 1
fi
echo "Activating and installing pips"
source ${venv}/bin/activate
echo ""
echo "Sourcing: ./envs/${env_name}.env"
source ./envs/${env_name}.env
echo ""
cd webapp
echo ""
which python
pip list
echo ""
echo ""
env | grep DJANGO | sort
echo ""
echo ""
echo "Deploying Sphinx docs"
./build-docs.sh
echo ""
echo ""
echo "Deploying Statics"
./collect-statics.sh
echo ""
echo ""
echo "Starting Django listening on TCP port 8010"
echo "http://localhost:8010/swagger"
echo ""
# runserver has issues with
# threads which break keras
# python ./manage.py runserver 0.0.0.0:8010
if [[ "${APP_SERVER}" == "uwsgi" ]]; then
uwsgi ./django-uwsgi.ini --thunder-lock
else
if [[ "${DJANGO_DEBUG}" == "yes" ]]; then
gunicorn -c ./django-gunicorn.py drf_network_pipeline.wsgi
else
gunicorn -c ./django-gunicorn.py drf_network_pipeline.wsgi
fi
fi