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.

74 lines
3.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. #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. # *** identitySvc image ***
  16. $identitySvcPathToJson = $scriptPath + "\src\Services\Identity\eShopOnContainers.Identity\project.json"
  17. Write-Host "identitySvcPathToJson is $identitySvcPathToJson" -ForegroundColor Yellow
  18. $identitySvcPathToPub = $scriptPath + "\pub\identity"
  19. Write-Host "identitySvcPathToPub is $identitySvcPathToPub" -ForegroundColor Yellow
  20. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  21. dotnet restore $identitySvcPathToJson
  22. dotnet build $identitySvcPathToJson
  23. dotnet publish $identitySvcPathToJson -o $identitySvcPathToPub
  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. #!/bin/bash
  52. # Delete all containers
  53. docker rm $(docker ps -a -q) -f
  54. # Delete all images
  55. docker rmi $(docker images -q)
  56. #*** build docker images ***
  57. docker build -t eshop/web $webPathToPub
  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/identity $identitySvcPathToPub