41.StressTest-publish.bat 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. @echo off
  2. ::启用变量延迟
  3. setlocal EnableDelayedExpansion
  4. ::(x.1)获取basePath
  5. set curPath=%cd%
  6. cd /d "%~dp0"
  7. cd /d ../../..
  8. set basePath=%cd%
  9. ::(x.2)
  10. set publishPath=%basePath%/Publish/release/release/StressTest
  11. echo ------------------------------------------------------------------
  12. echo "(x.3)发布CL压测"
  13. ::Client
  14. cd /d "%basePath%\dotnet\Library\Sers\Sers.CL\Test\CommunicationManage\CmClient"
  15. dotnet build --configuration Release
  16. dotnet publish --configuration Release --output "%publishPath%\CL压测netcoreapp2.1\CmClient"
  17. @if errorlevel 1 (echo . & echo . & echo 出错,请排查!& pause)
  18. ::Server
  19. cd /d "%basePath%\dotnet\Library\Sers\Sers.CL\Test\CommunicationManage\CmServer"
  20. dotnet build --configuration Release
  21. dotnet publish --configuration Release --output "%publishPath%\CL压测netcoreapp2.1\CmServer"
  22. @if errorlevel 1 (echo . & echo . & echo 出错,请排查!& pause)
  23. ::copy bat
  24. xcopy "%basePath%\Publish\ReleaseFile\StressTest\CL压测" "%publishPath%\CL压测netcoreapp2.1" /e /i /r /y
  25. echo ------------------------------------------------------------------
  26. ::(x.4)发布Sers压测
  27. for %%i in (netcoreapp2.1,net5.0) do (
  28. set netVersion=%%i
  29. set appPath=%basePath%/Publish/release/release/Station^(!netVersion!^)
  30. echo 发布 压测-!netVersion!
  31. ::单体压测
  32. set targetPath=%publishPath%/单体压测!netVersion!
  33. ::(x.x.1)copy ServiceCenter
  34. xcopy "!appPath!\ServiceCenter" "!targetPath!\ServiceCenter" /e /i /r /y
  35. ::(x.x.2)copy demo
  36. xcopy "!appPath!\Demo\wwwroot" "!targetPath!\ServiceCenter\wwwroot" /e /i /r /y
  37. xcopy "!appPath!\Demo\Did.SersLoader.Demo.dll" "!targetPath!\ServiceCenter" /i /r /y
  38. xcopy "!appPath!\Demo\Did.SersLoader.Demo.pdb" "!targetPath!\ServiceCenter" /i /r /y
  39. xcopy "!appPath!\Demo\Did.SersLoader.Demo.xml" "!targetPath!\ServiceCenter" /i /r /y
  40. ::(x.x.3)copy Robot
  41. xcopy "!appPath!\Robot\wwwroot" "!targetPath!\ServiceCenter\wwwroot" /e /i /r /y
  42. xcopy "!appPath!\Robot\App.Robot.Station.dll" "!targetPath!\ServiceCenter" /i /r /y
  43. xcopy "!appPath!\Robot\App.Robot.Station.pdb" "!targetPath!\ServiceCenter" /i /r /y
  44. xcopy "!appPath!\Robot\App.Robot.Station.xml" "!targetPath!\ServiceCenter" /i /r /y
  45. ::(x.x.4)copy ReleaseFile
  46. xcopy "%basePath%\Publish\ReleaseFile\StressTest\单体压测" "!targetPath!" /e /i /r /y
  47. ::分布式压测
  48. set targetPath=%publishPath%/分布式压测!netVersion!
  49. ::(x.x.1)copy station
  50. xcopy "!appPath!\ServiceCenter" "!targetPath!\ServiceCenter" /e /i /r /y
  51. xcopy "!appPath!\Demo" "!targetPath!\Demo" /e /i /r /y
  52. xcopy "!appPath!\Robot" "!targetPath!\Robot" /e /i /r /y
  53. ::(x.x.2)copy ReleaseFile
  54. xcopy "%basePath%\Publish\ReleaseFile\StressTest\分布式压测" "!targetPath!" /e /i /r /y
  55. )
  56. echo %~n0.bat 执行成功!
  57. cd /d "%curPath%"