diff options
author | Pjotr Prins | 2018-01-29 15:10:09 +0000 |
---|---|---|
committer | Pjotr Prins | 2018-01-29 15:10:09 +0000 |
commit | 85819dbeaf922456dc205e482e7e338952945d9b (patch) | |
tree | a8649fb42df66660a871d2aabf41163ffec4a06a /bin | |
parent | b3724d60d2e50dd19e61140406aa85dff981ac16 (diff) | |
download | genenetwork2-85819dbeaf922456dc205e482e7e338952945d9b.tar.gz |
Gunicorn works
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/genenetwork2 | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/bin/genenetwork2 b/bin/genenetwork2 index f32c76eb..f6ae3807 100755 --- a/bin/genenetwork2 +++ b/bin/genenetwork2 @@ -31,7 +31,7 @@ # # env GN2_PROFILE=~/opt/gn-latest-guix ./bin/genenetwork2 ./etc/default_settings.py -gunicorn "--bind 0.0.0.0:8000 --workers=2 --chdir wqflask/gunicorn/ wsgi" -SCRIPT=$(readlink -f "$0") +SCRIPT=$(realpath "$0") GN2_BASE_DIR=$(dirname $(dirname "$SCRIPT")) GN2_ID=$(cat /etc/hostname):$(basename $GN2_BASE_DIR) @@ -50,15 +50,25 @@ else fi echo GN_VERSION=$GN_VERSION +if [ "$1" = "-c" -o "$1" = "-gunicorn" ]; then + echo "Can not use $1 switch without default settings file" + exit 1 +fi # Handle settings parameter (can be .py or .json) -settings=$1 -ext="${settings##*.}" -if [ -z "$settings" -o "$ext" = "json" -o "$ext" = "JSON" ]; then - overrides=$settings +settings=$(realpath "$1") +if [ ! -e $settings ]; then settings=$GN2_BASE_DIR/etc/default_settings.py else shift fi + +ext="${settings##*.}" +if [ "$ext" = "json" -o "$ext" = "JSON" ]; then + overrides=$settings +else + echo $settings +fi + if [ ! -e $settings ]; then echo "ERROR: can not locate settings file - pass it in the command line" exit 1 @@ -132,12 +142,12 @@ if [ "$1" = '-c' ] ; then exit 0 fi if [ "$1" = '-gunicorn' ] ; then - cd $GN2_BASE_DIR - cmd=${2} + cd $GN2_BASE_DIR/wqflask + cmd=$2 echo PYTHONPATH=$PYTHONPATH - echo RUNNING COMMAND gunicorn $cmd + echo RUNNING gunicorn $cmd gunicorn $cmd - exit 0 + exit $? fi echo "Starting the redis server:" |