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.

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