Template
CI reads Infisical staging as the read-only convexmonorepo-base-ci machine identity, runs the quality gate, and builds and pushes the image. The template is not deployed, so there is no Convex or VPS deploy step. The local stack moves to its own Compose name and ports so it runs beside the Payload template's, and it syncs the Convex runtime env. The scripts pick up Infisical account switching, dev-kill and a cache-safe CI install.
45 lines
1.2 KiB
Bash
Executable File
45 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Kill any lingering host-level dev servers (Next.js, Expo Metro, Convex CLI
|
|
# watchers, turbo orchestrators) that survived a Ctrl-C. Does not touch the
|
|
# dockerized Convex/Postgres stack — use `bun db:down` for that.
|
|
#
|
|
# Usage: scripts/dev-kill (wired as `bun dev:kill`)
|
|
set -euo pipefail
|
|
|
|
info() { printf '\033[36m▶ %s\033[0m\n' "$*"; }
|
|
ok() { printf '\033[32m✓ %s\033[0m\n' "$*"; }
|
|
|
|
PORTS=(3000 3001 8081 19000 19001 19002)
|
|
PATTERNS=('next-server' 'next dev' 'expo start' 'turbo run dev' 'convex dev')
|
|
|
|
killed=false
|
|
|
|
for port in "${PORTS[@]}"; do
|
|
pids="$(lsof -ti "tcp:$port" -sTCP:LISTEN 2>/dev/null || true)"
|
|
[ -z "$pids" ] && continue
|
|
for pid in $pids; do
|
|
cmd="$(ps -p "$pid" -o comm= 2>/dev/null || true)"
|
|
info "Killing $cmd (pid $pid) on port $port"
|
|
kill "$pid" 2>/dev/null || true
|
|
killed=true
|
|
done
|
|
done
|
|
|
|
for pattern in "${PATTERNS[@]}"; do
|
|
pids="$(pgrep -f "$pattern" 2>/dev/null || true)"
|
|
[ -z "$pids" ] && continue
|
|
for pid in $pids; do
|
|
info "Killing '$pattern' (pid $pid)"
|
|
kill "$pid" 2>/dev/null || true
|
|
killed=true
|
|
done
|
|
done
|
|
|
|
if [ "$killed" = true ]; then
|
|
sleep 1
|
|
ok "Dev servers stopped."
|
|
else
|
|
ok "No dev servers were running."
|
|
fi
|