Publish.ps1 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. IF (-not(Test-Path ../wing/server/Measure/)) { New-Item -Path ../WingCloudServer/src/bin/Debug/net6.0/ -Name Measure -Type Directory -force }
  48. Copy-Item ../WingRemedicalModule/src/bin/Debug/net6.0/MeasureItemFiles/Measure/* -Destination ../WingCloudServer/src/bin/Debug/net6.0/Measure
  49. IF (-not(Test-Path ../wing/server/Comment/)) { New-Item -Path ../WingCloudServer/src/bin/Debug/net6.0/ -Name Comment -Type Directory -force }
  50. Copy-Item ../WingRemedicalModule/src/bin/Debug/net6.0/MeasureItemFiles/Comment/* -Destination ../WingCloudServer/src/bin/Debug/net6.0/Comment
  51. Copy-Item -recurse -Force ../WingServerCommon/bin/Debug/net6.0/publish/WingServerCommon.dll -Destination ../WingCloudServer/src/bin/Debug/net6.0/WingServerCommon.dll
  52. Copy-Item -recurse -Force ../WingServerCommon/bin/Debug/net6.0/publish/WingServerCommon.dll -Destination ../WingCloudServer/src/bin/Debug/net6.0/Dependencies/WingServerCommon.dll
  53. Write-Host 'Finished!' -NoNewline
  54. $null = [Console]::ReadKey('?')