SPB Git

spb/tendril Public

Tendril — web ingestion platform (scrape/crawl/map/search) on macOS Apple Silicon: WebKit fidelity, authenticated pages, deterministic testable extraction. A self-hosted Firecrawl alternative.

JavaScript 82.6% TypeScript 11.8% HTML 5.3%
1.2 KB · 32 lines shellscript
Raw Blame History
1#!/usr/bin/env bash2# author: simon-pierre boucher <contact@spboucher.ai>3# Deploy Tendril to the production node (§16.4). Idempotent: rsync source,4# install, build, (re)start PM2, then smoke-test through the public URL.5set -euo pipefail67NODE="${TENDRIL_NODE:-M3U96a}"8DIR="${TENDRIL_DIR:-apps/tendril}"9PORT="${TENDRIL_PORT:-8092}"10PUBLIC_URL="${TENDRIL_PUBLIC_URL:-https://www.ten-dril.com}"11HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"1213echo "==> rsync source to ${NODE}:${DIR}"14ssh "$NODE" "mkdir -p ~/${DIR}"15rsync -az --delete \16  --exclude node_modules --exclude '.git' --exclude 'dist' \17  --exclude '*.tsbuildinfo' --exclude 'coverage' --exclude 'blobs' \18  "$HERE"/ "${NODE}:${DIR}/"1920echo "==> install + build on ${NODE}"21ssh "$NODE" "cd ~/${DIR} && pnpm install --frozen-lockfile && pnpm build"2223echo "==> (re)start PM2"24ssh "$NODE" "cd ~/${DIR} && TENDRIL_DIR=\$HOME/${DIR} TENDRIL_PORT=${PORT} pm2 startOrReload deploy/ecosystem.config.cjs --update-env && pm2 save"2526echo "==> local health"27ssh "$NODE" "for i in \$(seq 1 40); do curl -sf http://127.0.0.1:${PORT}/healthz >/dev/null && { echo healthy; break; }; sleep 0.5; done"2829echo "==> smoke test through ${PUBLIC_URL}"30"$HERE/scripts/health.sh" "$PUBLIC_URL"31echo "==> done"32