Updated scripts to enable deploying prod server
This commit is contained in:
@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user