41.dotnet-publish-by-netVersion.sh 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. set -e
  2. #---------------------------------------------------------------------
  3. #(x.1)参数
  4. args_="
  5. export codePath=/root/temp/svn/dotnet
  6. export netVersion=netcoreapp2.1
  7. # "
  8. #----------------------------------------------
  9. echo "(x.2)dotnet-publish"
  10. echo "dotnet version: ${netVersion}"
  11. docker run -i --rm \
  12. --env LANG=C.UTF-8 \
  13. -v $codePath:/root/code \
  14. serset/dotnet:6.0-sdk \
  15. bash -c "
  16. set -e
  17. echo 'publish Gateway'
  18. cd /root/code/Gateway/App.Gateway
  19. dotnet build --configuration Release
  20. dotnet publish --configuration Release --output /root/code/Doc/Publish/SersPublish/${netVersion}/Gateway
  21. echo 'publish Gover'
  22. cd /root/code/ServiceCenter/App.Gover.Gateway
  23. dotnet build --configuration Release
  24. dotnet publish --configuration Release --output /root/code/Doc/Publish/SersPublish/${netVersion}/Gover
  25. echo 'publish ServiceCenter'
  26. cd /root/code/ServiceCenter/App.ServiceCenter
  27. dotnet build --configuration Release
  28. dotnet publish --configuration Release --output /root/code/Doc/Publish/SersPublish/${netVersion}/ServiceCenter
  29. echo 'publish Demo'
  30. cd /root/code/ServiceStation/Demo/SersLoader/Did.SersLoader.Demo
  31. dotnet build --configuration Release
  32. dotnet publish --configuration Release --output /root/code/Doc/Publish/SersPublish/${netVersion}/Demo
  33. echo 'publish Robot'
  34. cd /root/code/ServiceStation/Demo/StressTest/App.Robot.Station
  35. dotnet build --configuration Release
  36. dotnet publish --configuration Release --output /root/code/Doc/Publish/SersPublish/${netVersion}/Robot
  37. "
  38. #----------------------------------------------
  39. echo "(x.3)dotnet-copy file"
  40. echo "copy bat"
  41. cp -rf "$codePath/Doc/PublishFile/SersPublish/." "$codePath/Doc/Publish/SersPublish/$netVersion"
  42. echo "copy xml"
  43. targetFolder="$codePath/Doc/Publish/SersPublish/$netVersion"
  44. for file in "$codePath/ServiceCenter/App.ServiceCenter/bin/Release/$netVersion/*.xml" ; do cp -rf $file $targetFolder/ServiceCenter;done
  45. for file in "$codePath/ServiceStation/Demo/StressTest/App.Robot.Station/bin/Release/$netVersion/*.xml" ; do cp -rf $file $targetFolder/Robot;done
  46. for file in "$codePath/ServiceStation/Demo/SersLoader/Did.SersLoader.Demo/bin/Release/$netVersion/*.xml" ; do cp -rf $file $targetFolder/Demo;done
  47. echo 'publish succeed!'