mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-14 16:55:42 +00:00
34 lines
799 B
Bash
Executable File
34 lines
799 B
Bash
Executable File
#!/bin/bash
|
|
source venv/bin/activate
|
|
if [[ "${NOPAQUE_DAEMON_ENABLED:-True}" == "True" ]]; then
|
|
echo "INFO Starting nopaque daemon process..."
|
|
./nopaque-daemon.sh &
|
|
fi
|
|
|
|
if [[ "${#}" -eq 0 ]]; then
|
|
while true; do
|
|
flask deploy
|
|
if [[ "${?}" == "0" ]]; then
|
|
break
|
|
fi
|
|
echo "Deploy command failed, retrying in 5 secs..."
|
|
sleep 5
|
|
done
|
|
gunicorn \
|
|
--access-logfile - \
|
|
--error-logfile - \
|
|
$([ "${ENABLE_GUNICORN_RELOAD:-False}" == "True" ] && echo "--reload") \
|
|
--worker-class eventlet \
|
|
-b :5000 \
|
|
-w 1 nopaque:app
|
|
elif [[ "${1}" == "flask" ]]; then
|
|
exec ${@:1}
|
|
else
|
|
echo "${0} [COMMAND]"
|
|
echo ""
|
|
echo "nopaque startup script"
|
|
echo ""
|
|
echo "Commands:"
|
|
echo " flask"
|
|
fi
|