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.

42 lines
1.9 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 publish $webPathToJson -o $webPathToPub
  14. #*** Catalog service image ***
  15. $catalogPathToJson = $scriptPath + "\src\Services\Catalog\Catalog.API\project.json"
  16. Write-Host "catalogPathToJson is $catalogPathToJson" -ForegroundColor Yellow
  17. $catalogPathToPub = $scriptPath + "\pub\catalog"
  18. Write-Host "catalogPathToPub is $catalogPathToPub" -ForegroundColor Yellow
  19. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  20. dotnet restore $catalogPathToJson
  21. dotnet publish $catalogPathToJson -o $catalogPathToPub
  22. #*** Ordering service image ***
  23. $orderingPathToJson = $scriptPath + "\src\Services\Ordering\Ordering.API\project.json"
  24. Write-Host "orderingPathToJson is $orderingPathToJson" -ForegroundColor Yellow
  25. $orderingPathToPub = $scriptPath + "\pub\ordering"
  26. Write-Host "orderingPathToPub is $orderingPathToPub" -ForegroundColor Yellow
  27. Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
  28. dotnet restore $orderingPathToJson
  29. dotnet publish $orderingPathToJson -o $orderingPathToPub
  30. docker build -t eshop/web $webPathToPub
  31. docker build -t eshop/catalog.api $catalogPathToPub
  32. docker build -t eshop/ordering.api $orderingPathToPub