Browse Source

Merge branch 'SychevIgor/ParallelBuild' of https://github.com/SychevIgor/eShopOnContainers into SychevIgor-SychevIgor/ParallelBuild

pull/317/head
Eduard Tomàs 7 years ago
parent
commit
2d8eafe587
1 changed files with 15 additions and 11 deletions
  1. +15
    -11
      cli-windows/build-bits.ps1

+ 15
- 11
cli-windows/build-bits.ps1 View File

@ -8,6 +8,9 @@ if ([string]::IsNullOrEmpty($rootPath)) {
}
Write-Host "Root path used is $rootPath" -ForegroundColor Yellow
workflow BuildAndPublish {
param ([string] $rootPath
)
$projectPaths =
@{Path="$rootPath\src\Web\WebMVC";Prj="WebMVC.csproj"},
@{Path="$rootPath\src\Web\WebSPA";Prj="WebSPA.csproj"},
@ -21,19 +24,20 @@ $projectPaths =
@{Path="$rootPath\src\Services\Payment\Payment.API";Prj="Payment.API.csproj"},
@{Path="$rootPath\src\Web\WebStatus";Prj="WebStatus.csproj"}
$projectPaths | foreach {
$projectPath = $_.Path
$projectFile = $_.Prj
$outPath = $_.Path + "\obj\Docker\publish"
$projectPathAndFile = "$projectPath\$projectFile"
Write-Host "Deleting old publish files in $outPath" -ForegroundColor Yellow
remove-item -path $outPath -Force -Recurse -ErrorAction SilentlyContinue
Write-Host "Publishing $projectPathAndFile to $outPath" -ForegroundColor Yellow
dotnet restore $projectPathAndFile
dotnet build $projectPathAndFile
dotnet publish $projectPathAndFile -o $outPath
foreach -parallel ($item in $projectPaths) {
$projectPath = $item.Path
$projectFile = $item.Prj
$outPath = $item.Path + "\obj\Docker\publish"
$projectPathAndFile = "$projectPath\$projectFile"
#Write-Host "Deleting old publish files in $outPath" -ForegroundColor Yellow
remove-item -path $outPath -Force -Recurse -ErrorAction SilentlyContinue
#Write-Host "Publishing $projectPathAndFile to $outPath" -ForegroundColor Yellow
dotnet build $projectPathAndFile
dotnet publish $projectPathAndFile -o $outPath
}
}
BuildAndPublish $rootPath
########################################################################################
# Delete old eShop Docker images


Loading…
Cancel
Save