File tree 6 files changed +84
-18
lines changed 6 files changed +84
-18
lines changed Original file line number Diff line number Diff line change 3
3
<ProductDependencies >
4
4
</ProductDependencies >
5
5
<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 " >
7
7
<Uri >https://github.com/dotnet/arcade</Uri >
8
- <Sha >ff6cc4e9c3eef575f62a33a642ca80e79d27c9bb </Sha >
8
+ <Sha >49750c02e63d0ad3a77d035bba7498a0b1acd218 </Sha >
9
9
</Dependency >
10
- <Dependency Name =" Microsoft.DotNet.Helix.Sdk" Version =" 7.0.0-beta.22111.10 " >
10
+ <Dependency Name =" Microsoft.DotNet.Helix.Sdk" Version =" 7.0.0-beta.22117.2 " >
11
11
<Uri >https://github.com/dotnet/arcade</Uri >
12
- <Sha >ff6cc4e9c3eef575f62a33a642ca80e79d27c9bb </Sha >
12
+ <Sha >49750c02e63d0ad3a77d035bba7498a0b1acd218 </Sha >
13
13
</Dependency >
14
- <Dependency Name =" Microsoft.DotNet.Build.Tasks.Packaging" Version =" 7.0.0-beta.22111.10 " >
14
+ <Dependency Name =" Microsoft.DotNet.Build.Tasks.Packaging" Version =" 7.0.0-beta.22117.2 " >
15
15
<Uri >https://github.com/dotnet/arcade</Uri >
16
- <Sha >ff6cc4e9c3eef575f62a33a642ca80e79d27c9bb </Sha >
16
+ <Sha >49750c02e63d0ad3a77d035bba7498a0b1acd218 </Sha >
17
17
</Dependency >
18
18
</ToolsetDependencies >
19
19
</Dependencies >
Original file line number Diff line number Diff line change 6
6
<PreReleaseVersionIteration >1</PreReleaseVersionIteration >
7
7
</PropertyGroup >
8
8
<PropertyGroup >
9
- <MicrosoftDotNetBuildTasksPackagingVersion >7.0.0-beta.22111.10 </MicrosoftDotNetBuildTasksPackagingVersion >
9
+ <MicrosoftDotNetBuildTasksPackagingVersion >7.0.0-beta.22117.2 </MicrosoftDotNetBuildTasksPackagingVersion >
10
10
</PropertyGroup >
11
11
</Project >
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change @@ -8,10 +8,6 @@ parameters:
8
8
# Optional: Enable publishing using release pipelines
9
9
enablePublishUsingPipelines : false
10
10
11
- # Optional: Disable component governance detection. In general, component governance
12
- # should be on for all jobs. Use only in the event of issues.
13
- disableComponentGovernance : false
14
-
15
11
# Optional: Enable running the source-build jobs to build repo from source
16
12
enableSourceBuild : false
17
13
@@ -41,11 +37,6 @@ parameters:
41
37
# Internal resources (telemetry, microbuild) can only be accessed from non-public projects,
42
38
# and some (Microbuild) should only be applied to non-PR cases for internal builds.
43
39
44
- # Sbom related params
45
- enableSbom : true
46
- PackageVersion : 7.0.0
47
- BuildDropPath : ' $(Build.SourcesDirectory)/artifacts'
48
-
49
40
jobs :
50
41
- ${{ each job in parameters.jobs }} :
51
42
- template : ../job/job.yml
Original file line number Diff line number Diff line change
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)
Original file line number Diff line number Diff line change 3
3
"dotnet" : " 6.0.100"
4
4
},
5
5
"msbuild-sdks" : {
6
- "Microsoft.DotNet.Arcade.Sdk" : " 7.0.0-beta.22111.10 " ,
7
- "Microsoft.DotNet.Helix.Sdk" : " 7.0.0-beta.22111.10 " ,
6
+ "Microsoft.DotNet.Arcade.Sdk" : " 7.0.0-beta.22117.2 " ,
7
+ "Microsoft.DotNet.Helix.Sdk" : " 7.0.0-beta.22117.2 " ,
8
8
"Microsoft.Build.Traversal" : " 2.0.2"
9
9
}
10
10
}
You can’t perform that action at this time.
0 commit comments