Add run-analysis helper script and tests
This commit is contained in:
parent
b1658d28ba
commit
2e7e75e4ce
3 changed files with 77 additions and 0 deletions
34
run-analysis.sh
Executable file
34
run-analysis.sh
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# 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
|
||||
|
||||
# Run analysis helpers
|
||||
echo "[INFO] Checking for missing domains..."
|
||||
python scripts/analyze.py check-missing-domains
|
||||
|
||||
echo "[INFO] Suggesting cache improvements..."
|
||||
python scripts/analyze.py suggest-cache
|
||||
|
||||
echo "[INFO] Detecting threats..."
|
||||
python scripts/analyze.py detect-threats
|
||||
|
||||
# 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