forked from niuniu/llm-intelligence
chore: prepare repository for publishing
This commit is contained in:
38
scripts/run_real_pipeline.sh
Executable file
38
scripts/run_real_pipeline.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
if [[ -f ".env.local" ]]; then
|
||||
# shellcheck disable=SC1091
|
||||
source ".env.local"
|
||||
fi
|
||||
if [[ -f ".env" ]]; then
|
||||
# shellcheck disable=SC1091
|
||||
source ".env"
|
||||
fi
|
||||
|
||||
if [[ -z "${DATABASE_URL:-}" ]]; then
|
||||
echo "DATABASE_URL 未设置" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z "${OPENROUTER_API_KEY:-}" ]]; then
|
||||
echo "OPENROUTER_API_KEY 未设置,无法执行真实采集" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
"$ROOT_DIR/scripts/apply_migration.sh"
|
||||
|
||||
go run "./scripts/fetch_openrouter.go" \
|
||||
-api-key "$OPENROUTER_API_KEY" \
|
||||
-db "$DATABASE_URL" \
|
||||
-out "$ROOT_DIR/models.json"
|
||||
|
||||
go run "./scripts/generate_daily_report.go" \
|
||||
-json "$ROOT_DIR/models.json" \
|
||||
-out "$ROOT_DIR/reports/daily"
|
||||
|
||||
psql "$DATABASE_URL" -Atqc \
|
||||
"select 'models', count(*) from models union all select 'model_prices', count(*) from model_prices union all select 'report_runs', count(*) from report_runs order by 1;"
|
||||
Reference in New Issue
Block a user