31 lines
982 B
Bash
31 lines
982 B
Bash
#!/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"
|