Files
weval-l99/l99-auto-after-snap.sh
2026-04-15 01:38:46 +02:00

41 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
# Wait for snap archiver to finish
echo "[$(date +%H:%M:%S)] Waiting for snap archiver to finish..."
while ps aux | grep wevia-snap-archiver | grep -v grep > /dev/null 2>&1; do
sleep 30
done
echo "[$(date +%H:%M:%S)] Snap archiver done. Restarting PHP..."
# Restart PHP-FPM for clean state
systemctl restart php8.5-fpm
sleep 5
echo "[$(date +%H:%M:%S)] Running Playwright visual..."
sudo -u www-data python3 -B /opt/weval-l99/l99-playwright-visual.py > /tmp/pw_auto.log 2>&1
PW=$(python3 -c "import json;d=json.load(open('/opt/weval-l99/playwright-visual-state.json'));print(sum(1 for t in d['tests'] if t['status']=='P'),len(d['tests']))")
echo "[$(date +%H:%M:%S)] Playwright: $PW"
echo "[$(date +%H:%M:%S)] Running fullscan..."
sudo -u www-data python3 -B /opt/weval-l99/l99-fullscan.py > /tmp/fs_auto.log 2>&1
# Restart PHP again before nonreg
systemctl restart php8.5-fpm
sleep 5
echo "[$(date +%H:%M:%S)] Running nonreg..."
sudo -u www-data python3 -B /opt/weval-nonreg/full-nonreg-serverside.py > /tmp/nr_auto.log 2>&1
echo "[$(date +%H:%M:%S)] Updating L99 state..."
python3 /opt/weval-l99/l99-state-updater.py > /tmp/l99_auto.log 2>&1
# Run l99-alive for final score
python3 /opt/weval-l99/l99-alive.py > /tmp/l99_alive_auto.log 2>&1
SCORE=$(python3 -c "import json;d=json.load(open('/opt/weval-l99/l99-state.json'));print(f'{d["pass"]}/{d["total"]} {d["health"]}')")
echo "[$(date +%H:%M:%S)] L99 FINAL: $SCORE"
# Git push
cd /var/www/html && git add -A && git commit -m "l99-auto-$(date +%d%b)" 2>&1 | tail -1
git push origin main 2>&1 | tail -1
echo "[$(date +%H:%M:%S)] DONE"