extending setup

This commit is contained in:
georg.sinn-schirwitz
2025-08-29 16:31:20 +02:00
parent 2dac771d47
commit 138fc64790
2 changed files with 73 additions and 36 deletions

30
setup.sh Normal file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Robust Debian-compatible setup script for the jobs web app
set -euo pipefail
PY=python3
if ! command -v ${PY} >/dev/null 2>&1; then
echo "python3 not found; try installing python3 and rerun this script"
exit 2
fi
echo "Creating virtualenv .venv"
${PY} -m venv .venv
echo "Activating virtualenv"
# shellcheck disable=SC1091
source .venv/bin/activate
echo "Upgrading pip and installing requirements"
pip install --upgrade pip setuptools wheel || true
if ! pip install -r requirements.txt; then
echo "pip install failed; inspect output above. Continuing to allow manual fixes."
fi
echo "Ensuring DB schema (if configured). Running: python setup.py mysql-init"
if ! python setup.py mysql-init; then
echo "setup.py mysql-init failed — check MySQL settings in config/settings.json"
# don't fail the whole script; the DB step is optional for local dev without MySQL
fi
echo "Setup complete. To activate the venv in this shell: source .venv/bin/activate"