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.

56 lines
2.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. #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. #*** Catalog service image ***
  16. $catalogPathToJson = $scriptPath + "\src\Services\Catalog\Catalog.API\project.json"
  17. Write-Host "catalogPathToJson is $catalogPathToJson" -ForegroundColor Yellow
  18. $catalogPathToPub = $scriptPath + "\pub\catalog"
  19. Write-Host "catalogPathToPub is $catalogPathToPub" -ForegroundColor Yellow
  20. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  21. dotnet restore $catalogPathToJson
  22. dotnet build $catalogPathToJson
  23. dotnet publish $catalogPathToJson -o $catalogPathToPub
  24. #*** Ordering service image ***
  25. $orderingPathToJson = $scriptPath + "\src\Services\Ordering\Ordering.API\project.json"
  26. Write-Host "orderingPathToJson is $orderingPathToJson" -ForegroundColor Yellow
  27. $orderingPathToPub = $scriptPath + "\pub\ordering"
  28. Write-Host "orderingPathToPub is $orderingPathToPub" -ForegroundColor Yellow
  29. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  30. dotnet restore $orderingPathToJson
  31. dotnet build $orderingPathToJson
  32. dotnet publish $orderingPathToJson -o $orderingPathToPub
  33. #*** Basket service image ***
  34. $basketPathToJson = $scriptPath + "\src\Services\Basket\Basket.API\project.json"
  35. Write-Host "basketPathToJson is $orderingPathToJson" -ForegroundColor Yellow
  36. $basketPathToPub = $scriptPath + "\pub\basket"
  37. Write-Host "basketPathToPub is $basketPathToPub" -ForegroundColor Yellow
  38. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  39. dotnet restore $basketPathToJson
  40. dotnet build $basketPathToPub
  41. dotnet publish $basketPathToJson -o $basketPathToPub
  42. docker build -t eshop/web $webPathToPub
  43. docker build -t eshop/catalog.api $catalogPathToPub
  44. docker build -t eshop/ordering.api $orderingPathToPub
  45. docker build -t eshop/basket.api $basketPathToPub