CHORE: Created .env file to store environment vars

This commit is contained in:
2024-02-18 19:22:35 +00:00
parent 01cf5d641b
commit dba4cf01a3
8 changed files with 48 additions and 33 deletions

View File

@ -2,23 +2,25 @@
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"
echo "Using DEFAULT Environ Value: prod"
# 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
export ENVIRON=prod
fi
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