mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Fix Get-AppveyorBuild to not just get latest build, but to use the build version to get the correct build. Fix get any failures function to also check for cancellations
This commit is contained in:
parent
9d0b30f09d
commit
7a3bfa26dc
@ -5,7 +5,7 @@ function Get-AppVeyorBuild {
|
|||||||
throw "missing api token for AppVeyor."
|
throw "missing api token for AppVeyor."
|
||||||
}
|
}
|
||||||
|
|
||||||
Invoke-RestMethod -Uri "https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG" -Method GET -Headers @{
|
Invoke-RestMethod -Uri "https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/build/$($env:APPVEYOR_BUILD_VERSION)" -Method GET -Headers @{
|
||||||
"Authorization" = "Bearer $env:APPVEYOR_API_TOKEN"
|
"Authorization" = "Bearer $env:APPVEYOR_API_TOKEN"
|
||||||
"Content-type" = "application/json"
|
"Content-type" = "application/json"
|
||||||
}
|
}
|
||||||
@ -92,13 +92,14 @@ function travisFinished {
|
|||||||
throw "Travis build did not finished in $env:TIMEOUT_MINS minutes"
|
throw "Travis build did not finished in $env:TIMEOUT_MINS minutes"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Returns true if any Appveyor build is "failed" or "cancelled"
|
||||||
function Get-Any-Appveyor-Failures {
|
function Get-Any-Appveyor-Failures {
|
||||||
(Get-AppVeyorBuild).build.jobs | Foreach-Object `
|
(Get-AppVeyorBuild).build.jobs | Foreach-Object `
|
||||||
{
|
{
|
||||||
$job = $_
|
$job = $_
|
||||||
switch ($job.status) {
|
switch ($job.status) {
|
||||||
"failed" { return $true }
|
"failed" { return $true }
|
||||||
Default { }
|
"cancelled" { return $true }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $false
|
return $false
|
||||||
|
Loading…
Reference in New Issue
Block a user