feat: add netplan configuration models and backend API for applying netplan
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 8s
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 8s
This commit is contained in:
92
start_dev.sh
Executable file
92
start_dev.sh
Executable file
@@ -0,0 +1,92 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Kill children on exit
|
||||
cleanup() {
|
||||
echo
|
||||
echo "🛑 Stopping dev environment…"
|
||||
kill 0 2>/dev/null
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
START_BE=true
|
||||
START_FE=true
|
||||
|
||||
case "$1" in
|
||||
backend|be)
|
||||
START_FE=false
|
||||
;;
|
||||
frontend|fe)
|
||||
START_BE=false
|
||||
;;
|
||||
"" )
|
||||
# default → both
|
||||
;;
|
||||
* )
|
||||
echo "❌ Unknown argument: $1"
|
||||
echo "Usage:"
|
||||
echo " ./dev.sh → start both"
|
||||
echo " ./dev.sh be → start backend only"
|
||||
echo " ./dev.sh fe → start frontend only"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
###############################
|
||||
# Backend
|
||||
###############################
|
||||
if [ "$START_BE" = true ]; then
|
||||
(
|
||||
echo "🚀 Starting backend…"
|
||||
cd backend || { echo "❌ backend folder missing"; exit 1; }
|
||||
|
||||
if [ ! -d venv ]; then
|
||||
echo "⚙️ Creating virtual environment…"
|
||||
python3 -m venv venv
|
||||
./venv/bin/pip install -r requirements.txt
|
||||
fi
|
||||
|
||||
echo "📡 Backend at http://localhost:8000"
|
||||
./venv/bin/uvicorn src.main:app --reload --host 0.0.0.0 --port 8000
|
||||
) &
|
||||
BE_PID=$!
|
||||
else
|
||||
echo "⏭ Skipping backend"
|
||||
fi
|
||||
|
||||
|
||||
###############################
|
||||
# Frontend
|
||||
###############################
|
||||
if [ "$START_FE" = true ]; then
|
||||
(
|
||||
echo "🚀 Starting frontend…"
|
||||
cd frontend || { echo "❌ frontend folder missing"; exit 1; }
|
||||
|
||||
if [ ! -d node_modules ]; then
|
||||
echo "📦 Installing frontend dependencies…"
|
||||
npm install
|
||||
fi
|
||||
|
||||
echo "🌍 Frontend at http://localhost:5173"
|
||||
npm run dev-local
|
||||
) &
|
||||
FE_PID=$!
|
||||
else
|
||||
echo "⏭ Skipping frontend"
|
||||
fi
|
||||
|
||||
|
||||
###############################
|
||||
# Wait for both
|
||||
###############################
|
||||
echo
|
||||
echo "💡 Dev environment running."
|
||||
[ "$START_BE" = true ] && echo " Backend PID: $BE_PID"
|
||||
[ "$START_FE" = true ] && echo " Frontend PID: $FE_PID"
|
||||
echo " Press CTRL+C to stop everything."
|
||||
echo
|
||||
|
||||
wait
|
||||
Reference in New Issue
Block a user