-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathstart_dev.sh
More file actions
executable file
·60 lines (50 loc) · 1.66 KB
/
Copy pathstart_dev.sh
File metadata and controls
executable file
·60 lines (50 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
# DEV convenience script — starts the full dev stack in foreground.
#
# Launches three background processes:
# - Proxy on port 8001 (public, tunnel connects here)
# - Solve app on port 8011 (internal → /rmac/solve/)
# - Filter app on port 8012 (internal → /rmac/filter/)
#
# Press Ctrl-C to stop all three.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")" && pwd)"
LOG_DIR="${ROOT}/logs"
mkdir -p "$LOG_DIR"
# Kill anything on our ports
for PORT in 8001 8011 8012; do
PIDS=$(lsof -ti:${PORT} 2>/dev/null || true)
if [[ -n "$PIDS" ]]; then
echo " Clearing port ${PORT} (PIDs: $PIDS)…"
kill -TERM $PIDS 2>/dev/null || true
sleep 0.5
fi
done
cleanup() {
echo ""
echo "[dev] Stopping all dev processes…"
kill $PROXY_PID $SOLVE_PID $FILTER_PID 2>/dev/null || true
wait 2>/dev/null || true
exit 0
}
trap cleanup INT TERM
echo "[dev] Starting solve app (port 8011)…"
bash "${ROOT}/start_solve_dev.sh" > "${LOG_DIR}/solve_dev.log" 2>&1 &
SOLVE_PID=$!
echo "[dev] Starting filter app (port 8012)…"
bash "${ROOT}/start_filter_dev.sh" > "${LOG_DIR}/filter_dev.log" 2>&1 &
FILTER_PID=$!
sleep 2
echo "[dev] Starting proxy (port 8001)…"
bash "${ROOT}/start_proxy_dev.sh" > "${LOG_DIR}/proxy_dev.log" 2>&1 &
PROXY_PID=$!
sleep 2
echo ""
echo "[dev] Stack ready:"
echo " http://localhost:8001/rmac/solve/ ← solve"
echo " http://localhost:8001/rmac/filter/ ← filter"
echo " http://localhost:8001/ ← redirects to solve"
echo ""
echo " Logs: tail -f logs/proxy_dev.log logs/solve_dev.log logs/filter_dev.log"
echo " Press Ctrl-C to stop."
wait $PROXY_PID $SOLVE_PID $FILTER_PID