Updated scripts to enable deploying prod server

This commit is contained in:
2024-01-28 01:19:37 +00:00
parent d80b07d43d
commit 3eea1d946a
3 changed files with 38 additions and 20 deletions

View File

@ -1,2 +1,24 @@
#! /bin/bash
pytest --disable-warnings && python ./scripts/create_database.py && python ./app.py
pytest --disable-warnings
python ./scripts/create_database.py
EXPECTED_VALUE="test"
if [ -z "$ENVIRON" ]; then
echo "ENVIRON is not set."
else
echo "ENVIRON is set to: $ENVIRON"
# Trim leading and trailing whitespaces
ACTUAL_VALUE=$(echo "$ENVIRON" | tr -d '[:space:]')
if [ "$ACTUAL_VALUE" = "$EXPECTED_VALUE" ]; then
echo "Launching DEV Server"
python ./app.py
else
echo "Launching PROD Server"
waitress-serve --host 0.0.0.0 app:app
fi
fi