2020-10-08 10:34:02 +00:00
|
|
|
#!/bin/bash
|
2020-11-19 11:29:40 +00:00
|
|
|
source venv/bin/activate
|
2020-11-19 14:20:18 +00:00
|
|
|
if [[ "${NOPAQUE_DAEMON_ENABLED:-True}" == "True" ]]; then
|
2020-11-17 13:58:03 +00:00
|
|
|
echo "INFO Starting nopaque daemon process..."
|
2020-11-13 14:01:53 +00:00
|
|
|
./nopaque-daemon.sh &
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${#}" -eq 0 ]]; then
|
|
|
|
while true; do
|
|
|
|
flask deploy
|
|
|
|
if [[ "${?}" == "0" ]]; then
|
|
|
|
break
|
|
|
|
fi
|
2020-11-17 13:58:03 +00:00
|
|
|
echo "Deploy command failed, retrying in 5 secs..."
|
2020-11-13 14:01:53 +00:00
|
|
|
sleep 5
|
|
|
|
done
|
2021-09-15 13:26:13 +00:00
|
|
|
gunicorn \
|
|
|
|
--access-logfile - \
|
|
|
|
--error-logfile - \
|
|
|
|
$([ "${ENABLE_GUNICORN_RELOAD:-False}" == "True" ] && echo "--reload") \
|
|
|
|
--worker-class eventlet \
|
|
|
|
-b :5000 \
|
|
|
|
-w 1 nopaque:app
|
2020-11-13 14:01:53 +00:00
|
|
|
elif [[ "${1}" == "flask" ]]; then
|
2020-10-08 10:34:02 +00:00
|
|
|
exec ${@:1}
|
|
|
|
else
|
2020-11-13 14:01:53 +00:00
|
|
|
echo "${0} [COMMAND]"
|
2020-10-08 10:34:02 +00:00
|
|
|
echo ""
|
|
|
|
echo "nopaque startup script"
|
|
|
|
echo ""
|
2020-10-08 21:10:07 +00:00
|
|
|
echo "Commands:"
|
2020-10-08 10:34:02 +00:00
|
|
|
echo " flask"
|
|
|
|
fi
|