Publish.ps1 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. dotnet nuget locals all --clear
  2. Function BuildService($serviceName, $copyDll, $copyXml=0, $servicePath='', $copyDest='')
  3. {
  4. if($servicePath -eq '')
  5. {
  6. $servicePath = "../$serviceName/src"
  7. }
  8. if($copyDest -eq '')
  9. {
  10. $copyDest = "../WingCloudServer/src/bin/Debug/net6.0"
  11. }
  12. nuget restore "$servicePath/$serviceName.csproj" -source "http://nuget.ius.plus:88/v3/index.json;https://nuget.cdn.azure.cn/v3/index.json"
  13. dotnet publish "$servicePath/$serviceName.csproj" -c Debug
  14. if($copyDll -eq 1)
  15. {
  16. Copy-Item -recurse -Force $servicePath/bin/Debug/net6.0/publish/$serviceName.dll -Destination $copyDest/Services/$serviceName.dll
  17. Copy-Item -recurse -Force $servicePath/bin/Debug/net6.0/publish/*.dll -Destination $copyDest/Dependencies/ -Exclude $serviceName.dll
  18. }
  19. if($copyXml -eq 1)
  20. {
  21. Copy-Item -recurse -Force $servicePath/bin/Debug/net6.0/publish/$serviceName.xml -Destination $copyDest/Services/$serviceName.xml
  22. Copy-Item -recurse -Force $servicePath/bin/Debug/net6.0/publish/*.xml -Destination $copyDest/Dependencies/ -Exclude $serviceName.xml
  23. }
  24. }
  25. ### server
  26. IF (-not(Test-Path ../WingCloudServer/src/bin/Debug/net6.0/Dependencies/)) { New-Item -Path ../WingCloudServer/src/bin/Debug/net6.0/ -Name Dependencies -Type Directory -force }
  27. IF (-not(Test-Path ../WingCloudServer/src/bin/Debug/net6.0/Services/)) { New-Item -Path ../WingCloudServer/src/bin/Debug/net6.0/ -Name Services -Type Directory -force }
  28. BuildService "WingServerCommon" 0 0 "../WingServerCommon"
  29. BuildService "WingInterfaceLibrary" 0 1
  30. BuildService "WingNotificationModule" 1 0 "../WingNotificationModule"
  31. BuildService "WingMongoDBModule" 1
  32. BuildService "WingStorageModule" 1
  33. BuildService "WingCloudServer" 0
  34. BuildService "WingSMSModule" 1
  35. BuildService "WingSessionModule" 1
  36. BuildService "WingEmailModule" 1
  37. IF (-not(Test-Path ../wing/server/EmailTemplate/)) { New-Item -Path ../WingCloudServer/src/bin/Debug/net6.0/ -Name EmailTemplate -Type Directory -force }
  38. Copy-Item ../WingEmailModule/src/bin/Debug/net6.0/EmailTemplate/* -Destination ../WingCloudServer/src/bin/Debug/net6.0/EmailTemplate
  39. BuildService "WingUserModule" 1
  40. IF (-not(Test-Path ../wing/server/RegionData/)) { New-Item -Path ../WingCloudServer/src/bin/Debug/net6.0/ -Name RegionData -Type Directory -force }
  41. Copy-Item ../WingUserModule/src/bin/Debug/net6.0/Region/* -Destination ../WingCloudServer/src/bin/Debug/net6.0/RegionData
  42. BuildService "WingManagementModule" 1
  43. BuildService "WingDeviceService" 1 0 "../WingDeviceService"
  44. BuildService "VidProcessService" 1 0 "../WingVidProcessService/VidProcessService"
  45. BuildService "ReportService" 1 0 "../WingReportService/ReportService"
  46. BuildService "WingRemedicalModule" 1
  47. Copy-Item -recurse -Force ../WingServerCommon/bin/Debug/net6.0/publish/WingServerCommon.dll -Destination ../WingCloudServer/src/bin/Debug/net6.0/WingServerCommon.dll
  48. Copy-Item -recurse -Force ../WingServerCommon/bin/Debug/net6.0/publish/WingServerCommon.dll -Destination ../WingCloudServer/src/bin/Debug/net6.0/Dependencies/WingServerCommon.dll
  49. Write-Host 'Finished!' -NoNewline
  50. $null = [Console]::ReadKey('?')