Refactor to split client from server
This commit is contained in:
@@ -65,9 +65,19 @@ stop_postgres() {
|
||||
# ──────────────────────── VM management ────────────────────────────────
|
||||
vm_ip() { incus list "$VM_NAME" -f csv -c 4 2>/dev/null | head -1 | awk '{print $1}'; }
|
||||
|
||||
detect_e2e_ip() {
|
||||
local bridge_cidr
|
||||
bridge_cidr="$(incus network get incusbr0 ipv4.address 2>/dev/null || true)"
|
||||
if [[ -z "$bridge_cidr" ]]; then echo ""; return; fi
|
||||
local gateway="${bridge_cidr%%/*}"
|
||||
echo "${gateway%.*}.146"
|
||||
}
|
||||
|
||||
start_vm() {
|
||||
log "starting VM '$VM_NAME' (port $PORT)…"
|
||||
local e2e_ip; e2e_ip="$(detect_e2e_ip)"
|
||||
VM_NAME="$VM_NAME" \
|
||||
VM_IP="$e2e_ip" \
|
||||
MUSIC_SOURCE="$MUSIC_DIR" \
|
||||
LISTEN_PORT="$PORT" \
|
||||
RUST_LOG=debug \
|
||||
|
||||
@@ -62,9 +62,21 @@ stop_postgres() {
|
||||
# ──────────────────────── VM management ────────────────────────────────
|
||||
vm_ip() { incus list "$VM_NAME" -f csv -c 4 2>/dev/null | head -1 | awk '{print $1}'; }
|
||||
|
||||
detect_e2e_ip() {
|
||||
local bridge_cidr
|
||||
bridge_cidr="$(incus network get incusbr0 ipv4.address 2>/dev/null || true)"
|
||||
if [[ -z "$bridge_cidr" ]]; then echo ""; return; fi
|
||||
local gateway="${bridge_cidr%%/*}"
|
||||
echo "${gateway%.*}.146"
|
||||
}
|
||||
|
||||
start_vm() {
|
||||
log "starting VM '$VM_NAME' (port $PORT)…"
|
||||
# e2e VM uses .146 to avoid colliding with the dev VM (.145)
|
||||
local e2e_ip
|
||||
e2e_ip="$(detect_e2e_ip)"
|
||||
VM_NAME="$VM_NAME" \
|
||||
VM_IP="$e2e_ip" \
|
||||
MUSIC_SOURCE="$MUSIC_DIR" \
|
||||
LISTEN_PORT="$PORT" \
|
||||
RUST_LOG=debug \
|
||||
|
||||
Reference in New Issue
Block a user