Skip to content

Commit

Permalink
Retain builds that are inserted to VS
Browse files Browse the repository at this point in the history
This retains builds for 2 years as required for SBOM preservation. It also solves our older problem of builds disappearing before we can push them to nuget.org  and github releases.
  • Loading branch information
AArnott committed Jan 13, 2022
1 parent 0a63bb2 commit 87ca413
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions azure-pipelines/vs-insertion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,12 @@ stages:
AutoCompleteMergeStrategy: Squash
- task: MicroBuildCleanup@1
displayName: Send Telemetry
- powershell: |
$contentType = 'application/json';
$headers = @{ Authorization = 'Bearer $(System.AccessToken)' };
$rawRequest = @{ daysValid = 365 * 2; definitionId = $(resources.pipeline.CI.pipelineID); ownerId = 'User:$(Build.RequestedForId)'; protectPipeline = $false; runId = $(resources.pipeline.CI.runId) };
$request = ConvertTo-Json @($rawRequest);
Write-Host $request
$uri = "$(System.CollectionUri)$(System.TeamProject)/_apis/build/retention/leases?api-version=6.0-preview.1";
Invoke-RestMethod -uri $uri -method POST -Headers $headers -ContentType $contentType -Body $request;
displayName: Retain inserted builds

0 comments on commit 87ca413

Please sign in to comment.