Skip to content

Commit 3b59e62

Browse files
committed
[Ignore] Add scripts for VSTS to pick PSES branches to include
1 parent 0e1ad8d commit 3b59e62

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

tools/releaseBuild/findPsesBuild.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
$branch = [uri]::EscapeDataString($env:PSES_BRANCH)
2+
$buildsUrl = "https://mscodehub.visualstudio.com/PowerShellEditorServices/_apis/build/Builds?definitions=441&branchName=refs%2Fheads%2F${branch}&resultFilter=succeeded&reasonFilter=individualCI%20OR%20manual"
3+
$headers = @{Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"}
4+
$builds = Invoke-RestMethod -ContentType application/json -Uri $buildsUrl -Headers $headers
5+
Write-Host "Got PSES_BRANCH: ${env:PSES_BRANCH}"
6+
Write-Host "Requested URL: $buildsUrl"
7+
Write-Host "Got response:`n$(ConvertTo-Json $builds)"
8+
Write-Host "setting PSES_BUILDID to $($builds.value[0].Id)"
9+
Write-Host "##vso[task.setvariable variable=PSES_BUILDID]$($builds.value[0].Id)"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
$vstsVariables = @{
2+
PSES_BRANCH = '2.0.0'
3+
}
4+
5+
# Use VSTS's API to set an env vars
6+
foreach ($var in $vstsVariables.Keys)
7+
{
8+
$val = $vstsVariables[$var]
9+
Write-Host "Setting var '$var' to value '$val'"
10+
Write-Host "##vso[task.setvariable variable=$var]$val"
11+
}

0 commit comments

Comments
 (0)