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.

93 lines
4.3 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. # *** WebMVC image ***
  6. $webPathToJson = $scriptPath + "\src\Web\WebMVC\project.json"
  7. Write-Host "webPathToJson is $webPathToJson" -ForegroundColor Yellow
  8. $webPathToPub = $scriptPath + "\pub\webMVC"
  9. Write-Host "webPathToPub is $webPathToPub" -ForegroundColor Yellow
  10. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  11. Write-Host "****************************************" -ForegroundColor Red
  12. Write-Host "webPathToJson: " + $webPathToJson -ForegroundColor Red
  13. Write-Host "webPathToPub: " + $webPathToPub -ForegroundColor Red
  14. dotnet restore $webPathToJson
  15. dotnet build $webPathToJson
  16. dotnet publish $webPathToJson -o $webPathToPub
  17. Write-Host "****************************************" -ForegroundColor Red
  18. # *** WebSPA image ***
  19. $webSPAPathToJson = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA\project.json"
  20. Write-Host "webSPAPathToJson is $webSPAPathToJson" -ForegroundColor Yellow
  21. $webSPAPathToPub = $scriptPath + "\pub\webSPA"
  22. $webSPAPathToNpmBat = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA\buildspa.bat"
  23. Write-Host "webSPAPathToPub is $webSPAPathToPub" -ForegroundColor Yellow
  24. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  25. dotnet restore $webSPAPathToJson
  26. dotnet build $webSPAPathToJson
  27. # Start-Process "cmd.exe" "/c " + $webSPAPathToNpmBat
  28. dotnet publish $webSPAPathToJson -o $webSPAPathToPub
  29. # *** identitySvc image ***
  30. $identitySvcPathToJson = $scriptPath + "\src\Services\Identity\eShopOnContainers.Identity\project.json"
  31. Write-Host "identitySvcPathToJson is $identitySvcPathToJson" -ForegroundColor Yellow
  32. $identitySvcPathToPub = $scriptPath + "\pub\identity"
  33. Write-Host "identitySvcPathToPub is $identitySvcPathToPub" -ForegroundColor Yellow
  34. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  35. dotnet restore $identitySvcPathToJson
  36. dotnet build $identitySvcPathToJson
  37. dotnet publish $identitySvcPathToJson -o $identitySvcPathToPub
  38. #*** Catalog service image ***
  39. $catalogPathToJson = $scriptPath + "\src\Services\Catalog\Catalog.API\project.json"
  40. Write-Host "catalogPathToJson is $catalogPathToJson" -ForegroundColor Yellow
  41. $catalogPathToPub = $scriptPath + "\pub\catalog"
  42. Write-Host "catalogPathToPub is $catalogPathToPub" -ForegroundColor Yellow
  43. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  44. dotnet restore $catalogPathToJson
  45. dotnet build $catalogPathToJson
  46. dotnet publish $catalogPathToJson -o $catalogPathToPub
  47. #*** Ordering service image ***
  48. $orderingPathToJson = $scriptPath + "\src\Services\Ordering\Ordering.API\project.json"
  49. Write-Host "orderingPathToJson is $orderingPathToJson" -ForegroundColor Yellow
  50. $orderingPathToPub = $scriptPath + "\pub\ordering"
  51. Write-Host "orderingPathToPub is $orderingPathToPub" -ForegroundColor Yellow
  52. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  53. dotnet restore $orderingPathToJson
  54. dotnet build $orderingPathToJson
  55. dotnet publish $orderingPathToJson -o $orderingPathToPub
  56. #*** Basket service image ***
  57. $basketPathToJson = $scriptPath + "\src\Services\Basket\Basket.API\project.json"
  58. Write-Host "basketPathToJson is $basketPathToJson" -ForegroundColor Yellow
  59. $basketPathToPub = $scriptPath + "\pub\basket"
  60. Write-Host "basketPathToPub is $basketPathToPub" -ForegroundColor Yellow
  61. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  62. dotnet restore $basketPathToJson
  63. dotnet build $basketPathToJson
  64. dotnet publish $basketPathToJson -o $basketPathToPub
  65. #!/bin/bash
  66. # Delete all containers
  67. docker rm $(docker ps -a -q) -f
  68. # Delete all images
  69. docker rmi $(docker images -q)
  70. #*** build docker images ***
  71. docker build -t eshop/web $webPathToPub
  72. docker build -t eshop/catalog.api $catalogPathToPub
  73. docker build -t eshop/ordering.api $orderingPathToPub
  74. docker build -t eshop/basket.api $basketPathToPub
  75. docker build -t eshop/webspa $webSPAPathToPub
  76. docker build -t eshop/identity $identitySvcPathToPub