@echo off echo "please make sure you update your yml config file!!!" set current_dir=%cd% set client_dir=D:\Desktop\test\zhiyi6\zhiyiFrontend set admin_dir=D:\Desktop\test\zhiyi6\zhiyiAdmin :restart echo "please select your option:" echo "0. close running java.exe" echo "1. pack client frontend" echo "2. pack admin frontend" echo "3. pack backend" echo "4. send client to test folder" echo "5. send admin to test folder" echo "6. send backend to test folder" echo "7. start backend" echo "8. reload nginx" echo "9. exit after execute!" set /p options= echo your option is: %options% echo %options% | findstr "0" >nul && ( echo "close java.exe" ssh administrator@192.168.50.200 "taskkill -f -im java.exe" ) echo %options% | findstr "1" >nul && ( echo "pack client frontend" cd %client_dir% && call npm run build ) echo %options% | findstr "2" >nul && ( echo "pack admin frontend" cd %admin_dir% && call npm run build ) echo %options% | findstr "3" >nul && ( echo "pack backend" cd %current_dir% && call mvn clean package ) echo %options% | findstr "4" >nul && ( echo "send client to test folder" scp -r %client_dir%/client administrator@192.168.50.200:E:\zhiyi7\nginx\html\ ) echo %options% | findstr "5" >nul && ( echo "send admin to test folder" scp -r %admin_dir%/admin administrator@192.168.50.200:E:\zhiyi7\nginx\html\ ) echo %options% | findstr "6" >nul && ( echo "send backend to test folder" scp %current_dir%/scaffold-web/target/scaffold-web.jar administrator@192.168.50.200:E:\zhiyi7\java\ ) echo %options% | findstr "7" >nul && ( echo "start backend" start ssh administrator@192.168.50.200 "java -jar E:\zhiyi7\java\scaffold-web.jar" ) echo %options% | findstr "8" >nul && ( echo "reload nginx" ssh administrator@192.168.50.200 "cd E:/zhiyi7/nginx && nginx.exe -s reload" ) echo %options% | findstr "9" >nul && exit echo "script ending..." goto restart pause exit