@echo off echo "please make sure you update your yml config file!!!" pause 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 "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. start nginx" set /p options= echo your option is: %options% 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 [email protected]:E:\zhiyi7\nginx\html\ ) echo %options% | findstr "5" >nul && ( echo "send admin to test folder" scp -r %admin_dir%/admin [email protected]:E:\zhiyi7\nginx\html\ ) echo %options% | findstr "6" >nul && ( echo "send backend to test folder" scp %current_dir%/scaffold-web/target/scaffold-web.jar [email protected]:E:\zhiyi7\java\ ) echo %options% | findstr "7" >nul && ( echo "start backend" ssh [email protected] "taskkill /f /im /java.exe" ssh [email protected] "java -jar E:\zhiyi7\java\scaffold-web.jar" ) echo %options% | findstr "8" >nul && ( echo "start nginx" ssh [email protected] "E:\zhiyi7\nginx\nginx.exe -s reload" ) echo "script ending..." goto restart pause exit rem cd D:\Desktop\test\zhiyi6\zhiyiBackend\scaffold-web\src\main\resources\static\zhiyiFrontend\ rem call npm run build rem cd D:\Desktop\test\zhiyi6\zhiyiBackend\scaffold-web\src\main\resources\static\zhiyiAdmin\ rem call npm run build cd D:\Desktop\test\zhiyi6\zhiyiBackend call mvn clean package
标签:脚本,findstr,bat,options%,echo,nul,&&,test From: https://www.cnblogs.com/laremehpe/p/17839216.html