@@ -117,20 +117,18 @@ test-kind:
117117stop :
118118 @echo " ==> Stopping all services..."
119119 @# Stop Docker services
120- @docker compose -f $(DOCKER_COMPOSE_MAIN ) down --remove-orphans 2> /dev/null || true
120+ @docker compose -f $(DOCKER_COMPOSE_MAIN ) down --remove-orphans || true
121121 @# Stop kind cluster
122- @kind delete cluster --name $(KIND_CLUSTER_NAME ) 2> /dev/null || true
122+ @kind delete cluster --name $(KIND_CLUSTER_NAME ) || true
123123ifndef GITHUB_ACTIONS
124124 @# Stop nginx if running
125- @-[ -f $(PID_FILE) ] && kill -TERM $$(cat $(PID_FILE)) 2>/dev/null || true
126- @-[ -f $(PID_FILE) ] && rm -f $(PID_FILE) 2>/dev/null || true
127- @# Stop backend services using PID files
128- @-kill $$(cat /tmp/echo-server.pid 2>/dev/null) 2>/dev/null || true
129- @-kill $$(cat /tmp/extproc_mock.pid 2>/dev/null) 2>/dev/null || true
130- @rm -f /tmp/extproc_mock.pid /tmp/echo-server.pid 2>/dev/null || true
131- @# Fallback: Stop processes by name/port (in case PID files are missing)
132- @-pkill -f "custom-echo-server.js" 2>/dev/null || true
133- @-pkill -f "extproc_mock" 2>/dev/null || true
125+ @-[ -f $(PID_FILE) ] && kill -TERM $$(cat $(PID_FILE)) || true
126+ @-[ -f $(PID_FILE) ] && rm -f $(PID_FILE) || true
127+ @# Stop backend services using PID files if they exist, otherwise use pkill
128+ @-sh -c 'if [ -f /tmp/echo-server.pid ]; then kill $$(cat /tmp/echo-server.pid) || true; else pkill -f "custom-echo-server.js" 2>/dev/null || true; fi' 2>/dev/null || true
129+ @-rm -f /tmp/echo-server.pid
130+ @-sh -c 'if [ -f /tmp/extproc_mock.pid ]; then kill $$(cat /tmp/extproc_mock.pid) || true; else pkill -f "extproc_mock" 2>/dev/null || true; fi' 2>/dev/null || true
131+ @-rm -f /tmp/extproc_mock.pid
134132endif
135133 @echo "✅ All services stopped."
136134
0 commit comments