-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get build data using darc instead of maestro web api (#7174)
- Loading branch information
1 parent
1311825
commit 71dbd36
Showing
6 changed files
with
82 additions
and
47 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[CmdletBinding()] | ||
Param( | ||
[Parameter(Mandatory=$true)][string] $BarId, | ||
[Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro.dot.net', | ||
[Parameter(Mandatory=$false)][string] $DarcVersion = $null | ||
) | ||
|
||
$ErrorActionPreference = 'Stop' | ||
Set-StrictMode -Version 2.0 | ||
|
||
$ci = $true | ||
$darc = $null | ||
try { | ||
$darc = (Get-Command darc).Source | ||
} | ||
catch { | ||
. $PSScriptRoot\..\..\common\tools.ps1 | ||
$darc = Get-Darc $DarcVersion | ||
} | ||
|
||
[string]$buildDataJson = & $darc get-build ` | ||
--id "$BarId" ` | ||
--extended ` | ||
--output-format json ` | ||
--bar-uri "$MaestroApiEndPoint" ` | ||
--ci | ||
|
||
Write-Verbose 'BuildData:' | ||
Write-Verbose $buildDataJson | ||
$buildData = $buildDataJson | ConvertFrom-Json | ||
|
||
if (!$buildData -or $buildData.Length -ne 1) { | ||
Write-Error 'Unable to obtain build data.' | ||
} | ||
|
||
Write-Output $buildData[0] |
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