-
Notifications
You must be signed in to change notification settings - Fork 24
/
ci-start-server.sh
executable file
·47 lines (31 loc) · 1.12 KB
/
ci-start-server.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
#!/bin/bash
SETTINGS_FILE=$1
if [[ -z "${SETTINGS_FILE}" ]]; then
echo -e "\nERROR: You must pass in a settings file to run with, e.g. 'ci_settings'\n"
exit -1
fi
echo "Ensure you have uwsgi installed (brew install uwsgi)"
VIRTUALENV_ACTIVATE="${UREPORT_VIRTUAL_ENV_HOME}/bin/activate"
cd ureport_project
echo "Starting server deamon with settings [${SETTINGS_FILE}.py] running in [`pwd`]"
if [ ! -d "target" ]; then
mkdir target
fi
echo -e "\nStarting Server...\n" > target/ureport-server.log
# --plugin-dir=/usr/lib/uwsgi \
# --plugins=python \
# --env DJANGO_SETTINGS_MODULE=ci_settings \
# --chdir=${UREPORT_HOME}/ureport_project \
# http://projects.unbit.it/uwsgi/wiki/Example - Good list of different ways to start uwsgi
uwsgi --master \
--pp .. \
--pidfile=target/server.pid \
--env="DJANGO_SETTINGS_MODULE=ureport_project.${SETTINGS_FILE}" \
--module=wsgi_app \
--socket=0.0.0.0:8001 \
--vacuum \
--virtualenv=${UREPORT_VIRTUAL_ENV_HOME} \
-w django_wsgi \
--daemonize=target/ureport-server.log
#echo $! > target/server.pid
cd ..