Merge branch 'SychevIgor-SychevIgor/ParallelBuild' into netcore2

This commit is contained in:
Eduard Tomàs 2017-09-05 08:43:48 +02:00
commit bbb36f3475

View File

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