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.

70 lines
3.1 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. Write-Host "webSPAPathToPub is $webSPAPathToPub" -ForegroundColor Yellow
  20. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  21. dotnet restore $webSPAPathToJson
  22. dotnet build $webSPAPathToJson
  23. dotnet publish $webSPAPathToJson -o $webSPAPathToPub
  24. #*** Catalog service image ***
  25. $catalogPathToJson = $scriptPath + "\src\Services\Catalog\Catalog.API\project.json"
  26. Write-Host "catalogPathToJson is $catalogPathToJson" -ForegroundColor Yellow
  27. $catalogPathToPub = $scriptPath + "\pub\catalog"
  28. Write-Host "catalogPathToPub is $catalogPathToPub" -ForegroundColor Yellow
  29. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  30. dotnet restore $catalogPathToJson
  31. dotnet build $catalogPathToJson
  32. dotnet publish $catalogPathToJson -o $catalogPathToPub
  33. #*** Ordering service image ***
  34. $orderingPathToJson = $scriptPath + "\src\Services\Ordering\Ordering.API\project.json"
  35. Write-Host "orderingPathToJson is $orderingPathToJson" -ForegroundColor Yellow
  36. $orderingPathToPub = $scriptPath + "\pub\ordering"
  37. Write-Host "orderingPathToPub is $orderingPathToPub" -ForegroundColor Yellow
  38. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  39. dotnet restore $orderingPathToJson
  40. dotnet build $orderingPathToJson
  41. dotnet publish $orderingPathToJson -o $orderingPathToPub
  42. #*** Basket service image ***
  43. $basketPathToJson = $scriptPath + "\src\Services\Basket\Basket.API\project.json"
  44. Write-Host "basketPathToJson is $basketPathToJson" -ForegroundColor Yellow
  45. $basketPathToPub = $scriptPath + "\pub\basket"
  46. Write-Host "basketPathToPub is $basketPathToPub" -ForegroundColor Yellow
  47. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  48. dotnet restore $basketPathToJson
  49. dotnet build $basketPathToJson
  50. dotnet publish $basketPathToJson -o $basketPathToPub
  51. docker build -t eshop/web $webPathToPub
  52. docker build -t eshop/catalog.api $catalogPathToPub
  53. docker build -t eshop/ordering.api $orderingPathToPub
  54. docker build -t eshop/basket.api $basketPathToPub
  55. docker build -t eshop/webspa $webSPAPathToPub