Skip to content
This repository was archived by the owner on Sep 26, 2024. It is now read-only.

Commit 51942e6

Browse files
dotnet-maestro-botdotnet-maestro[bot]TanayParikhHaoK
authored
[automated] Merge branch 'release/6.0.2xx' => 'main' (#80)
* Update dependencies from https://github.com/dotnet/arcade build 20220130.1 (#57) Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22071.6 -> To Version 7.0.0-beta.22080.1 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> * [release/6.0.2xx] Backport CODEOWNERS (#61) So we get appropriate notifications. Extension of #54. * Update dependencies from https://github.com/dotnet/arcade build 20220203.1 (#66) Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22080.1 -> To Version 7.0.0-beta.22103.1 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> * Update dependencies from https://github.com/dotnet/arcade build 20220211.10 (#71) Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22103.1 -> To Version 7.0.0-beta.22111.10 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> * Update dependencies from https://github.com/dotnet/arcade build 20220217.2 (#78) [release/6.0.2xx] Update dependencies from dotnet/arcade Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Tanay Parikh <[email protected]> Co-authored-by: Hao Kung <[email protected]>
1 parent 6a2fcca commit 51942e6

File tree

4 files changed

+78
-3
lines changed

4 files changed

+78
-3
lines changed

eng/Version.Details.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<ProductDependencies>
44
</ProductDependencies>
55
<ToolsetDependencies>
6-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.22111.10">
6+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.22117.2">
77
<Uri>https://github.com/dotnet/arcade</Uri>
8-
<Sha>ff6cc4e9c3eef575f62a33a642ca80e79d27c9bb</Sha>
8+
<Sha>49750c02e63d0ad3a77d035bba7498a0b1acd218</Sha>
99
</Dependency>
1010
</ToolsetDependencies>
1111
</Dependencies>

eng/common/retain-build.ps1

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
Param(
3+
[Parameter(Mandatory=$true)][int] $buildId,
4+
[Parameter(Mandatory=$true)][string] $azdoOrgUri,
5+
[Parameter(Mandatory=$true)][string] $azdoProject,
6+
[Parameter(Mandatory=$true)][string] $token
7+
)
8+
9+
$ErrorActionPreference = 'Stop'
10+
Set-StrictMode -Version 2.0
11+
. $PSScriptRoot\tools.ps1
12+
13+
14+
function Get-AzDOHeaders(
15+
[string] $token)
16+
{
17+
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":${token}"))
18+
$headers = @{"Authorization"="Basic $base64AuthInfo"}
19+
return $headers
20+
}
21+
22+
function Update-BuildRetention(
23+
[string] $azdoOrgUri,
24+
[string] $azdoProject,
25+
[int] $buildId,
26+
[string] $token)
27+
{
28+
$headers = Get-AzDOHeaders -token $token
29+
$requestBody = "{
30+
`"keepForever`": `"true`"
31+
}"
32+
33+
$requestUri = "${azdoOrgUri}/${azdoProject}/_apis/build/builds/${buildId}?api-version=6.0"
34+
write-Host "Attempting to retain build using the following URI: ${requestUri} ..."
35+
36+
try {
37+
Invoke-RestMethod -Uri $requestUri -Method Patch -Body $requestBody -Header $headers -contentType "application/json"
38+
Write-Host "Updated retention settings for build ${buildId}."
39+
}
40+
catch {
41+
Write-PipelineTelemetryError -Category "Build" -Message "Failed to update retention settings for build: $_.Exception.Response.StatusDescription"
42+
ExitWithExitCode 1
43+
}
44+
}
45+
46+
Update-BuildRetention -azdoOrgUri $azdoOrgUri -azdoProject $azdoProject -buildId $buildId -token $token
47+
ExitWithExitCode 0
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
parameters:
2+
# Optional azure devops PAT with build execute permissions for the build's organization,
3+
# only needed if the build that should be retained ran on a different organization than
4+
# the pipeline where this template is executing from
5+
Token: ''
6+
# Optional BuildId to retain, defaults to the current running build
7+
BuildId: ''
8+
# Azure devops Organization URI for the build in the https://dev.azure.com/<organization> format.
9+
# Defaults to the organization the current pipeline is running on
10+
AzdoOrgUri: '$(System.CollectionUri)'
11+
# Azure devops project for the build. Defaults to the project the current pipeline is running on
12+
AzdoProject: '$(System.TeamProject)'
13+
14+
steps:
15+
- task: powershell@2
16+
inputs:
17+
targetType: 'filePath'
18+
filePath: eng/common/retain-build.ps1
19+
pwsh: true
20+
arguments: >
21+
-AzdoOrgUri: ${{parameters.AzdoOrgUri}}
22+
-AzdoProject ${{parameters.AzdoProject}}
23+
-Token ${{coalesce(parameters.Token, '$env:SYSTEM_ACCESSTOKEN') }}
24+
-BuildId ${{coalesce(parameters.BuildId, '$env:BUILD_ID')}}
25+
displayName: Enable permanent build retention
26+
env:
27+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
28+
BUILD_ID: $(Build.BuildId)

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
"version": "6.0.100"
1212
},
1313
"msbuild-sdks": {
14-
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22111.10"
14+
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22117.2"
1515
}
1616
}

0 commit comments

Comments
 (0)