-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable POGO builds in MBv2 daily config, automatic NuGet generation a…
…nd publication. Add build composition script.
- Loading branch information
Showing
8 changed files
with
117 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#------------------------------------------------------------------------------------------------------- | ||
# Copyright (C) Microsoft. All rights reserved. | ||
# Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. | ||
#------------------------------------------------------------------------------------------------------- | ||
|
||
# Compose Build script | ||
# | ||
# Aggregate metadata about a build and produce a file with useful information about the build | ||
# for tools to consume and get a quick overview of the status of a completed build. | ||
|
||
param ( | ||
[Parameter(Mandatory=$True)] | ||
[string]$rootPath | ||
) | ||
|
||
# | ||
# Clean up the sentinel which previously marked this build as incomplete. | ||
# | ||
|
||
$buildIncompleteFile = Join-Path $rootPath "build.incomplete" | ||
if (Test-Path $buildIncompleteFile) { | ||
Remove-Item -Path $buildIncompleteFile -Force | ||
} | ||
|
||
# | ||
# Aggregate build metadata and produce build.json | ||
# | ||
|
||
$outputJsonFile = Join-Path -Path $rootPath -ChildPath "build.json" | ||
$buildInfo = New-Object System.Object | ||
|
||
$changeJson = (Get-ChildItem -Path $rootPath "change.json" -Recurse)[0] | % { $_.FullName } | ||
$changeInfo = (Get-Content $changeJson) -join "`n" | ConvertFrom-Json | ||
|
||
# Determine the overall build status. Mark the build as "passed" until "failed" is encountered. | ||
$overallBuildStatus = "passed" | ||
|
||
$files = Get-ChildItem -Path $rootPath "*.json" -Recurse ` | ||
| ? { ($_.Name -ne "change.json") -and ($_.Name -ne "build.json") } ` | ||
| % { $_.FullName } | ||
$builds = New-Object System.Collections.ArrayList | ||
foreach ($file in $files) { | ||
$json = (Get-Content $file) -join "`n" | ConvertFrom-Json | ||
$_ = $builds.Add($json) | ||
|
||
if ($json.status -eq "failed") { | ||
$overallBuildStatus = "failed" | ||
} | ||
} | ||
|
||
$buildInfo | Add-Member -type NoteProperty -name status -value $overallBuildStatus | ||
$buildInfo | Add-Member -type NoteProperty -name change -value $changeInfo | ||
$buildInfo | Add-Member -type NoteProperty -name builds -value $builds | ||
|
||
$buildInfo | ConvertTo-Json | Write-Output | ||
$buildInfo | ConvertTo-Json | Out-File $outputJsonFile -Encoding ascii |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters