forked from globocom/GloboNetworkAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start_networkapi.sh
executable file
·42 lines (28 loc) · 1.04 KB
/
start_networkapi.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
#!/bin/bash
if [ ! -d networkapi_venv ]; then
virtualenv networkapi_venv
fi
source networkapi_venv/bin/activate
pip install -r requirements.txt
echo "exporting DJANGO_SETTINGS_MODULE"
export DJANGO_SETTINGS_MODULE='networkapi.settings'
echo "exporting NETWORKAPI_DEBUG=1"
export NETWORKAPI_DEBUG=1
echo "exporting NETWORKAPI_ALLOWED_HOSTS=10.0.0.2,localhost,127.0.0.1"
export NETWORKAPI_ALLOWED_HOSTS=10.0.0.2,localhost,127.0.0.1
echo "exporting NETWORKAPI_BROKER_DESTINATION"
export NETWORKAPI_BROKER_DESTINATION='networkapi'
echo "exporting NETWORKAPI_BROKER_URI"
export NETWORKAPI_BROKER_URI='tcp://localhost:61613'
echo "Starting ActiveMQ message broker"
sudo service activemq start
echo "Starting RabbitMQ message broker"
sudo service rabbitmq start
echo "clearing memcached:"
echo 'flush_all' | nc localhost 11211
echo "killing gunicorn"
sudo killall gunicorn
echo "cleaning up .pyc"
python /vagrant/manage.py clean_pyc --path /vagrant/networkapi/
echo "starting gunicorn"
/usr/local/bin/gunicorn -c /vagrant/gunicorn.conf.py wsgi:application