nopaque/boot.sh

34 lines
849 B
Bash
Raw Normal View History

#!/bin/bash
source venv/bin/activate
2020-11-13 14:01:53 +00:00
if [[ "${#}" -eq 0 ]]; then
while true; do
echo "INFO Run deployment tasks..."
2020-11-13 14:01:53 +00:00
flask deploy
if [[ "${?}" == "0" ]]; then
break
fi
echo "WARNING ...Failed, retrying in 5 secs..."
2020-11-13 14:01:53 +00:00
sleep 5
done
if [[ "${NOPAQUE_DAEMON_ENABLED:-True}" == "True" ]]; then
echo "INFO Start nopaque daemon..."
flask daemon run &
fi
2021-11-15 13:35:37 +00:00
echo "INFO Start nopaque..."
gunicorn \
--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
exec ${@:1}
else
2020-11-13 14:01:53 +00:00
echo "${0} [COMMAND]"
echo ""
echo "nopaque startup script"
echo ""
2020-10-08 21:10:07 +00:00
echo "Commands:"
echo " flask"
fi