mirror of
https://github.com/nomadkaraoke/karaoke-gen.git
synced 2026-11-20 13:07:57 +09:00
## Summary - Add `--quiet` flag to `gcloud beta emulators firestore start` to prevent interactive prompts that hang CI/agent sessions - Fix `stop-emulators.sh` to kill Java child processes (`pkill -P`) with port-based fallback for orphans on port 8080 - Generate unique Playwright dev server port per worktree (3100-3199 hash range) to prevent cross-worktree conflicts ## Test plan - [ ] `./scripts/start-emulators.sh` starts without interactive prompts - [ ] `./scripts/stop-emulators.sh` kills Java emulator child processes (no orphans on port 8080) - [ ] Playwright config generates different ports for different worktree directories - [ ] `E2E_PORT` env var still overrides the default port <!-- @coderabbitai ignore --> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
48 lines
1.5 KiB
Bash
Executable File
48 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
# Stop GCP emulators
|
|
# This script stops Firestore and GCS emulators
|
|
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
EMULATOR_LOG_DIR="$PROJECT_ROOT/.emulator-logs"
|
|
|
|
echo "🛑 Stopping GCP emulators..."
|
|
echo ""
|
|
|
|
# Stop Firestore emulator
|
|
if [ -f "$EMULATOR_LOG_DIR/firestore.pid" ]; then
|
|
FIRESTORE_PID=$(cat "$EMULATOR_LOG_DIR/firestore.pid")
|
|
if ps -p $FIRESTORE_PID > /dev/null 2>&1; then
|
|
echo "📦 Stopping Firestore emulator (PID: $FIRESTORE_PID)..."
|
|
# Kill the process and its children (Java emulator subprocess)
|
|
pkill -P $FIRESTORE_PID 2>/dev/null || true
|
|
kill $FIRESTORE_PID 2>/dev/null || true
|
|
fi
|
|
rm -f "$EMULATOR_LOG_DIR/firestore.pid"
|
|
fi
|
|
# Always clean up by port as a fallback (catches orphaned Java processes)
|
|
REMAINING=$(lsof -ti:8080 2>/dev/null || true)
|
|
if [ -n "$REMAINING" ]; then
|
|
echo "📦 Cleaning up remaining processes on port 8080..."
|
|
kill $REMAINING 2>/dev/null || true
|
|
echo " ✅ Firestore emulator stopped"
|
|
else
|
|
echo "⚠️ Firestore emulator not running"
|
|
fi
|
|
|
|
# Stop GCS emulator
|
|
if docker ps -q -f name=test-gcs-emulator > /dev/null 2>&1; then
|
|
echo "📦 Stopping GCS emulator (Docker container)..."
|
|
docker stop test-gcs-emulator >/dev/null 2>&1 || true
|
|
docker rm test-gcs-emulator >/dev/null 2>&1 || true
|
|
echo " ✅ GCS emulator stopped"
|
|
else
|
|
echo "⚠️ GCS emulator not running"
|
|
fi
|
|
|
|
echo ""
|
|
echo "🎉 Emulators stopped successfully!"
|
|
|