Skip to content

Commit bbb36f3

Browse files
committed
Merge branch 'SychevIgor-SychevIgor/ParallelBuild' into netcore2
2 parents 8198126 + dcc1ec6 commit bbb36f3

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

cli-windows/build-bits.ps1

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,35 @@ if ([string]::IsNullOrEmpty($rootPath)) {
88
}
99
Write-Host "Root path used is $rootPath" -ForegroundColor Yellow
1010

11+
workflow BuildAndPublish {
12+
param ([string] $rootPath
13+
)
1114
$projectPaths =
1215
@{Path="$rootPath\src\Web\WebMVC";Prj="WebMVC.csproj"},
1316
@{Path="$rootPath\src\Web\WebSPA";Prj="WebSPA.csproj"},
1417
@{Path="$rootPath\src\Services\Identity\Identity.API";Prj="Identity.API.csproj"},
1518
@{Path="$rootPath\src\Services\Catalog\Catalog.API";Prj="Catalog.API.csproj"},
1619
@{Path="$rootPath\src\Services\Ordering\Ordering.API";Prj="Ordering.API.csproj"},
1720
@{Path="$rootPath\src\Services\Basket\Basket.API";Prj="Basket.API.csproj"},
18-
@{Path="$rootPath\src\Services\GracePeriod\GracePeriodManager";Prj="GracePeriodManager.csproj"},
1921
@{Path="$rootPath\src\Services\Location\Locations.API";Prj="Locations.API.csproj"},
2022
@{Path="$rootPath\src\Services\Marketing\Marketing.API";Prj="Marketing.API.csproj"},
2123
@{Path="$rootPath\src\Services\Payment\Payment.API";Prj="Payment.API.csproj"},
2224
@{Path="$rootPath\src\Web\WebStatus";Prj="WebStatus.csproj"}
2325

24-
$projectPaths | foreach {
25-
$projectPath = $_.Path
26-
$projectFile = $_.Prj
27-
$outPath = $_.Path + "\obj\Docker\publish"
28-
$projectPathAndFile = "$projectPath\$projectFile"
29-
Write-Host "Deleting old publish files in $outPath" -ForegroundColor Yellow
30-
remove-item -path $outPath -Force -Recurse -ErrorAction SilentlyContinue
31-
Write-Host "Publishing $projectPathAndFile to $outPath" -ForegroundColor Yellow
32-
dotnet restore $projectPathAndFile
33-
dotnet build $projectPathAndFile
34-
dotnet publish $projectPathAndFile -o $outPath
26+
foreach -parallel ($item in $projectPaths) {
27+
$projectPath = $item.Path
28+
$projectFile = $item.Prj
29+
$outPath = $item.Path + "\obj\Docker\publish"
30+
$projectPathAndFile = "$projectPath\$projectFile"
31+
#Write-Host "Deleting old publish files in $outPath" -ForegroundColor Yellow
32+
remove-item -path $outPath -Force -Recurse -ErrorAction SilentlyContinue
33+
#Write-Host "Publishing $projectPathAndFile to $outPath" -ForegroundColor Yellow
34+
dotnet build $projectPathAndFile
35+
dotnet publish $projectPathAndFile -o $outPath
36+
}
3537
}
3638

39+
BuildAndPublish $rootPath
3740

3841
########################################################################################
3942
# Delete old eShop Docker images

0 commit comments

Comments
 (0)