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.

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