SPB Git forge
28commits 1branches 0releases
7.7 MBsize
maindefault branch
10 days agolast push
Python 66.3% TypeScript 22.7% JavaScript 8.6% HTML 1.4% CSS 0.7%
1.2 KB · 26 lines shellscript
Raw Blame History
1#!/bin/bash2# First run on the production node (run ON the node from ~/apps/company-atlas, ideally under nohup):3#   nohup bash deploy/first-run.sh > ~/company-atlas-data/logs/first-run.log 2>&1 &4# 1. migrate + seed (idempotent)  2. mass onboarding (discovery → sensors)  3. first metrics/daily pass.5# The PM2 scheduler (`catlas schedule`) keeps running in parallel: it also consumes the discovery queue and the due sensors,6# so this script only accelerates the initial onboarding with a dedicated worker.7set -euo pipefail8cd "$(dirname "$0")/.."9export PATH="$HOME/.local/bin:/opt/homebrew/opt/postgresql@17/bin:/opt/homebrew/bin:$PATH"10export DATABASE_URL=${DATABASE_URL:-postgresql+asyncpg://companyatlas:companyatlas@127.0.0.1:5432/companyatlas}11export CA_DATA_DIR=${CA_DATA_DIR:-$HOME/company-atlas-data}12export CA_LOG_JSON=013CATLAS=.venv/bin/catlas14CONC=${CA_ONBOARDING_CONCURRENCY:-16}1516$CATLAS migrate | tail -117$CATLAS seed | tail -218echo "== onboarding (discovery + sensors) for every pending company, concurrency $CONC"19$CATLAS onboard --concurrency "$CONC" || true20echo "== first intelligence pass"21$CATLAS process-changes --limit 5000 || true22$CATLAS metrics --all || true23$CATLAS daily --catch-up || true24$CATLAS stats || true25echo "== done $(date)"26