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.

80 lines
3.6 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. # *** WebSPA image ***
  6. $webSPAPath = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA"
  7. $webSPAPathToJson = $webSPAPath + "\project.json"
  8. Write-Host "webSPAPathToJson is $webSPAPathToJson" -ForegroundColor Yellow
  9. $webSPAPathToPub = $scriptPath + "\pub\webSPA"
  10. Write-Host "webSPAPathToPub is $webSPAPathToPub" -ForegroundColor Yellow
  11. Write-Host "Installing npm dependencies"
  12. Start-Process -WorkingDirectory $webSPAPath -NoNewWindow -Wait npm i
  13. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  14. dotnet restore $webSPAPathToJson
  15. dotnet build $webSPAPathToJson
  16. dotnet publish $webSPAPathToJson -o $webSPAPathToPub
  17. # *** identitySvc image ***
  18. $identitySvcPathToJson = $scriptPath + "\src\Services\Identity\eShopOnContainers.Identity\project.json"
  19. Write-Host "identitySvcPathToJson is $identitySvcPathToJson" -ForegroundColor Yellow
  20. $identitySvcPathToPub = $scriptPath + "\pub\identity"
  21. Write-Host "identitySvcPathToPub is $identitySvcPathToPub" -ForegroundColor Yellow
  22. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  23. dotnet restore $identitySvcPathToJson
  24. dotnet build $identitySvcPathToJson
  25. dotnet publish $identitySvcPathToJson -o $identitySvcPathToPub
  26. #*** Catalog service image ***
  27. $catalogPathToJson = $scriptPath + "\src\Services\Catalog\Catalog.API\project.json"
  28. Write-Host "catalogPathToJson is $catalogPathToJson" -ForegroundColor Yellow
  29. $catalogPathToPub = $scriptPath + "\pub\catalog"
  30. Write-Host "catalogPathToPub is $catalogPathToPub" -ForegroundColor Yellow
  31. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  32. dotnet restore $catalogPathToJson
  33. dotnet build $catalogPathToJson
  34. dotnet publish $catalogPathToJson -o $catalogPathToPub
  35. #*** Ordering service image ***
  36. $orderingPath = $scriptPath + "\src\Services\Ordering"
  37. Write-Host "orderingPath is $orderingPath" -ForegroundColor Yellow
  38. $orderingApiPathToJson = $orderingPath + "\Ordering.API\project.json"
  39. Write-Host "orderingApiPathToJson is $orderingApiPathToJson" -ForegroundColor Yellow
  40. $orderingApiPathToPub = $scriptPath + "\pub\ordering"
  41. Write-Host "orderingApiPathToPub is $orderingApiPathToPub" -ForegroundColor Yellow
  42. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  43. dotnet restore $orderingPath
  44. dotnet build $orderingApiPathToJson
  45. dotnet publish $orderingApiPathToJson -o $orderingApiPathToPub
  46. #*** Basket service image ***
  47. $basketPathToJson = $scriptPath + "\src\Services\Basket\Basket.API\project.json"
  48. Write-Host "basketPathToJson is $basketPathToJson" -ForegroundColor Yellow
  49. $basketPathToPub = $scriptPath + "\pub\basket"
  50. Write-Host "basketPathToPub is $basketPathToPub" -ForegroundColor Yellow
  51. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  52. dotnet restore $basketPathToJson
  53. dotnet build $basketPathToJson
  54. dotnet publish $basketPathToJson -o $basketPathToPub
  55. #!/bin/bash
  56. # Delete all containers
  57. docker rm $(docker ps -a -q) -f
  58. # Delete all images
  59. docker rmi $(docker images -q)
  60. #*** build docker images ***
  61. docker build -t eshop/catalog.api $catalogPathToPub
  62. docker build -t eshop/ordering.api $orderingPathToPub
  63. docker build -t eshop/basket.api $basketPathToPub
  64. docker build -t eshop/webspa $webSPAPathToPub
  65. docker build -t eshop/identity $identitySvcPathToPub