Tweaks & changes for deployment

This commit is contained in:
oitsjustjose 2025-06-14 15:04:02 -05:00
commit 284c016e21
7 changed files with 156 additions and 4 deletions

28
start.sh Executable file
View file

@ -0,0 +1,28 @@
#!/bin/bash
# Get an absolute path to the script
basedir=$(dirname $0)
absdir=$(realpath -s "${PWD}/${basedir}")
if [ -d "${absdir}/.venv" ]; then
echo "${absdir}/.venv exists - removing and resetting"
rm -rf "${absdir}/.venv"
fi
pythoncmd=$(command -v python) || $(command -v python3)
$pythoncmd -m venv "${absdir}/.venv"
echo "Made venv successfully"
source "${absdir}/.venv/bin/activate"
echo "Activated venv successfully"
# Re-assess the python command now that we're in the venv
pythoncmd=$(command -v python) || $(command -v python3)
$pythoncmd -m pip install -r "${absdir}/requirements.txt" >/dev/null 2>&1
echo "Installed Python requirements successfully"
cd "${absdir}/src"
echo "Starting up.."
$pythoncmd __main__.py