29 行
1.1 KiB
Bash
29 行
1.1 KiB
Bash
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
cd /Users/x/websafe
|
|
source /Users/x/websafe/scripts/load-local-env.sh
|
|
LOG_DIR="/Users/x/websafe/08-threat-intel/generated/logs"
|
|
mkdir -p "$LOG_DIR"
|
|
STAMP="$(date '+%Y%m%d-%H%M%S')"
|
|
exec >> "$LOG_DIR/weekly-$STAMP.log" 2>&1
|
|
|
|
run_pr() {
|
|
if [[ "${WEBSAFE_PR_MODE:-auto}" == "skip" ]]; then
|
|
echo "[weekly] PR skipped by WEBSAFE_PR_MODE=skip"
|
|
elif [[ "${WEBSAFE_PR_MODE:-auto}" == "dry-run" || -z "${GITEA_TOKEN:-}" ]]; then
|
|
python3 /Users/x/websafe/scripts/intel/main.py open-pr --dry-run
|
|
else
|
|
python3 /Users/x/websafe/scripts/intel/main.py open-pr
|
|
fi
|
|
}
|
|
|
|
echo "[weekly] $(date -u '+%Y-%m-%dT%H:%M:%SZ') starting"
|
|
python3 /Users/x/websafe/scripts/intel/main.py reconcile
|
|
python3 /Users/x/websafe/scripts/intel/main.py sync-versions --deep
|
|
python3 /Users/x/websafe/scripts/lab/main.py retry-failures --limit "${WEBSAFE_RETRY_LIMIT:-100}"
|
|
python3 /Users/x/websafe/scripts/lab/main.py run-batch --from-queue --limit "${WEBSAFE_WEEKLY_LIMIT:-50}"
|
|
python3 /Users/x/websafe/scripts/intel/main.py render
|
|
python3 /Users/x/websafe/scripts/intel/main.py validate
|
|
run_pr
|