forked from dotnet/aspnetcore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'v6.0.25' into feature/JIT-96177
# Conflicts: # NuGet.config # eng/Version.Details.xml # eng/Versions.props # global.json
- Loading branch information
Showing
128 changed files
with
13,972 additions
and
5,116 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,45 @@ | ||
|
||
Param( | ||
[Parameter(Mandatory=$true)][int] $buildId, | ||
[Parameter(Mandatory=$true)][string] $azdoOrgUri, | ||
[Parameter(Mandatory=$true)][string] $azdoProject, | ||
[Parameter(Mandatory=$true)][string] $token | ||
) | ||
|
||
$ErrorActionPreference = 'Stop' | ||
Set-StrictMode -Version 2.0 | ||
|
||
function Get-AzDOHeaders( | ||
[string] $token) | ||
{ | ||
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":${token}")) | ||
$headers = @{"Authorization"="Basic $base64AuthInfo"} | ||
return $headers | ||
} | ||
|
||
function Update-BuildRetention( | ||
[string] $azdoOrgUri, | ||
[string] $azdoProject, | ||
[int] $buildId, | ||
[string] $token) | ||
{ | ||
$headers = Get-AzDOHeaders -token $token | ||
$requestBody = "{ | ||
`"keepForever`": `"true`" | ||
}" | ||
|
||
$requestUri = "${azdoOrgUri}/${azdoProject}/_apis/build/builds/${buildId}?api-version=6.0" | ||
write-Host "Attempting to retain build using the following URI: ${requestUri} ..." | ||
|
||
try { | ||
Invoke-RestMethod -Uri $requestUri -Method Patch -Body $requestBody -Header $headers -contentType "application/json" | ||
Write-Host "Updated retention settings for build ${buildId}." | ||
} | ||
catch { | ||
Write-Error "Failed to update retention settings for build: $_.Exception.Response.StatusDescription" | ||
exit 1 | ||
} | ||
} | ||
|
||
Update-BuildRetention -azdoOrgUri $azdoOrgUri -azdoProject $azdoProject -buildId $buildId -token $token | ||
exit 0 |
Oops, something went wrong.