You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
3.9 KiB

  1. $scriptPath = Split-Path $script:MyInvocation.MyCommand.Path
  2. Write-Host "Current script directory is $scriptPath" -ForegroundColor Yellow
  3. $pubFolderToDelete = $scriptPath + "\pub"
  4. remove-item -path $pubFolderToDelete -Force -Recurse -ErrorAction SilentlyContinue
  5. #cmd /c "rd /s pub" /q
  6. # *** WebMVC image ***
  7. $webPathToJson = $scriptPath + "\src\Web\WebMVC\project.json"
  8. Write-Host "webPathToJson is $webPathToJson" -ForegroundColor Yellow
  9. $webPathToPub = $scriptPath + "\pub\webMVC"
  10. Write-Host "webPathToPub is $webPathToPub" -ForegroundColor Yellow
  11. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  12. dotnet restore $webPathToJson
  13. dotnet build $webPathToJson
  14. dotnet publish $webPathToJson -o $webPathToPub
  15. # *** WebSPA image ***
  16. $webSPAPathToJson = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA\project.json"
  17. Write-Host "webSPAPathToJson is $webSPAPathToJson" -ForegroundColor Yellow
  18. $webSPAPathToPub = $scriptPath + "\pub\webSPA"
  19. #$webSPAPathToNpmBat = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA\buildspa.bat"
  20. Write-Host "webSPAPathToPub is $webSPAPathToPub" -ForegroundColor Yellow
  21. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  22. dotnet restore $webSPAPathToJson
  23. dotnet build $webSPAPathToJson
  24. #Start-Process "cmd.exe" "/c " + $webSPAPathToNpmBat
  25. dotnet publish $webSPAPathToJson -o $webSPAPathToPub
  26. # *** identitySvc image ***
  27. $identitySvcPathToJson = $scriptPath + "\src\Services\Identity\eShopOnContainers.Identity\project.json"
  28. Write-Host "identitySvcPathToJson is $identitySvcPathToJson" -ForegroundColor Yellow
  29. $identitySvcPathToPub = $scriptPath + "\pub\identity"
  30. Write-Host "identitySvcPathToPub is $identitySvcPathToPub" -ForegroundColor Yellow
  31. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  32. dotnet restore $identitySvcPathToJson
  33. dotnet build $identitySvcPathToJson
  34. dotnet publish $identitySvcPathToJson -o $identitySvcPathToPub
  35. #*** Catalog service image ***
  36. $catalogPathToJson = $scriptPath + "\src\Services\Catalog\Catalog.API\project.json"
  37. Write-Host "catalogPathToJson is $catalogPathToJson" -ForegroundColor Yellow
  38. $catalogPathToPub = $scriptPath + "\pub\catalog"
  39. Write-Host "catalogPathToPub is $catalogPathToPub" -ForegroundColor Yellow
  40. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  41. dotnet restore $catalogPathToJson
  42. dotnet build $catalogPathToJson
  43. dotnet publish $catalogPathToJson -o $catalogPathToPub
  44. #*** Ordering service image ***
  45. $orderingPathToJson = $scriptPath + "\src\Services\Ordering\Ordering.API\project.json"
  46. Write-Host "orderingPathToJson is $orderingPathToJson" -ForegroundColor Yellow
  47. $orderingPathToPub = $scriptPath + "\pub\ordering"
  48. Write-Host "orderingPathToPub is $orderingPathToPub" -ForegroundColor Yellow
  49. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  50. dotnet restore $orderingPathToJson
  51. dotnet build $orderingPathToJson
  52. dotnet publish $orderingPathToJson -o $orderingPathToPub
  53. #*** Basket service image ***
  54. $basketPathToJson = $scriptPath + "\src\Services\Basket\Basket.API\project.json"
  55. Write-Host "basketPathToJson is $basketPathToJson" -ForegroundColor Yellow
  56. $basketPathToPub = $scriptPath + "\pub\basket"
  57. Write-Host "basketPathToPub is $basketPathToPub" -ForegroundColor Yellow
  58. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  59. dotnet restore $basketPathToJson
  60. dotnet build $basketPathToJson
  61. dotnet publish $basketPathToJson -o $basketPathToPub
  62. #*** build docker images ***
  63. docker build -t eshop/web $webPathToPub
  64. docker build -t eshop/catalog.api $catalogPathToPub
  65. docker build -t eshop/ordering.api $orderingPathToPub
  66. docker build -t eshop/basket.api $basketPathToPub
  67. docker build -t eshop/webspa $webSPAPathToPub
  68. docker build -t eshop/identity $identitySvcPathToPub