Unify import script
This commit is contained in:
parent
15770f5161
commit
075717041c
4 changed files with 36 additions and 24 deletions
|
@ -1,13 +1,28 @@
|
|||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
echo "[INFO] Creating virtual environment..."
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
# Ensure virtual environment exists
|
||||
if [ ! -d ".venv" ]; then
|
||||
echo "[INFO] Creating virtual environment..."
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
echo "[INFO] Installing dependencies..."
|
||||
pip install --upgrade pip
|
||||
if [ -f requirements.txt ]; then
|
||||
pip install -r requirements.txt
|
||||
else
|
||||
echo "[WARN] requirements.txt not found, skipping."
|
||||
fi
|
||||
else
|
||||
echo "[INFO] Activating virtual environment..."
|
||||
source .venv/bin/activate
|
||||
fi
|
||||
|
||||
echo "[INFO] Installing dependencies..."
|
||||
pip install --upgrade pip
|
||||
pip install -r requirements.txt || echo "[WARN] requirements.txt not found, skipping."
|
||||
|
||||
echo "[INFO] Running database setup..."
|
||||
# Run log import
|
||||
echo "[INFO] Importing logs..."
|
||||
python scripts/init_db.py
|
||||
|
||||
# Deactivate to keep cron environment clean
|
||||
if type deactivate >/dev/null 2>&1; then
|
||||
deactivate
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue