forked from niuniu/llm-intelligence
27 lines
1.4 KiB
Bash
27 lines
1.4 KiB
Bash
|
|
#!/bin/bash
|
||
|
|
|
||
|
|
set -euo pipefail
|
||
|
|
|
||
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||
|
|
. "$SCRIPT_DIR/verify_common.sh"
|
||
|
|
|
||
|
|
TODAY="$(date +%Y-%m-%d)"
|
||
|
|
ARCHIVE_DIR="reports/daily/$(date +%Y/%m)"
|
||
|
|
|
||
|
|
echo "=== Phase 3 验收检查 ==="
|
||
|
|
|
||
|
|
check_executable "scripts/run_daily.sh" "日报流水线脚本可执行"
|
||
|
|
check_executable "scripts/feishu_alert.sh" "飞书告警脚本可执行"
|
||
|
|
check_shell "日报生成器可独立构建" "go build -o /dev/null ./scripts/generate_daily_report.go"
|
||
|
|
check_shell "日报脚本包含降级逻辑" "grep -q 'fallback_report' scripts/run_daily.sh"
|
||
|
|
check_shell "日报脚本包含飞书告警逻辑" "grep -q 'send_alert' scripts/run_daily.sh"
|
||
|
|
check_shell "今日日报文件存在且包含数据质量摘要" "test -f reports/daily/daily_report_${TODAY}.md && grep -q '数据质量摘要' reports/daily/daily_report_${TODAY}.md"
|
||
|
|
check_shell "今日归档报告存在" "test -f ${ARCHIVE_DIR}/daily_report_${TODAY}.md"
|
||
|
|
check_sql_int_ge "daily_report 已写入至少 1 条 generated 记录" \
|
||
|
|
"select count(*) from daily_report where status='generated';" \
|
||
|
|
1
|
||
|
|
check_shell "crontab 已配置每日调度" "crontab -l 2>/dev/null | grep -q 'scripts/run_daily.sh'"
|
||
|
|
check_shell "真实采集 API Key 已配置" "([ -n \"${OPENROUTER_API_KEY:-}\" ] || ([ -f .env.local ] && grep -Eq '^OPENROUTER_API_KEY=.+' .env.local) || ([ -f .env ] && grep -Eq '^OPENROUTER_API_KEY=.+' .env))"
|
||
|
|
|
||
|
|
finish_phase
|