Repository navigation
Expand file tree
/
Copy pathvs-insertion.yml
More file actions
100 lines (94 loc) · 3.95 KB
/
Copy pathvs-insertion.yml
File metadata and controls
100 lines (94 loc) · 3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
trigger: none # We only want to trigger manually or based on resources
pr: none
resources:
repositories:
- repository: MicroBuildTemplate
type: git
name: 1ESPipelineTemplates/MicroBuildTemplate
ref: refs/tags/release
pipelines:
- pipeline: CI
source: Library # TODO: This should match the name of your CI pipeline
tags:
- Real signed
trigger:
tags:
- Real signed
variables:
- template: GlobalVariables.yml
extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
settings:
networkIsolationPolicy: Permissive,CFSClean2
sdl:
sourceAnalysisPool: VSEng-MicroBuildVSStable
sbom:
enabled: false
stages:
- stage: insertion
jobs:
- job: upload
displayName: Upload VS payload
pool: VSEng-MicroBuildVSStable
templateContext:
outputParentDirectory: $(Pipeline.Workspace)/CI
steps:
- checkout: none
- powershell: Write-Host "##vso[build.updatebuildnumber]$(resources.pipeline.CI.runName)"
displayName: ⚙️ Set pipeline name
- template: azure-pipelines/release-deployment-prep.yml@self
- download: CI
artifact: VSInsertion-Windows
displayName: 🔻 Download VSInsertion-Windows artifact
- ${{ if eq(variables['ContainsVsix'], 'true') }}:
- task: 1ES.MicroBuildVstsDrop@1
displayName: 🔺 Upload VSTS Drop
inputs:
dropFolder: $(Pipeline.Workspace)/CI/VSInsertion-windows/Vsix
dropName: $(VstsDropNames)
accessToken: $(System.AccessToken)
- task: 1ES.PublishNuget@1
displayName: 📦 Push VS-repo packages to VS feed
inputs:
packagesToPush: '$(Pipeline.Workspace)/CI/VSInsertion-Windows/*.nupkg'
packageParentPath: $(Pipeline.Workspace)/CI/VSInsertion-Windows
allowPackageConflicts: true
publishVstsFeed: VS
- job: insert
dependsOn: upload
displayName: VS insertion
pool: VSEngSS-MicroBuild2022-1ES
templateContext:
outputParentDirectory: $(Pipeline.Workspace)/CI
steps:
- checkout: none
- template: azure-pipelines/release-deployment-prep.yml@self
- download: CI
artifact: VSInsertion-Windows
displayName: 🔻 Download VSInsertion-Windows artifact
- task: MicroBuildInsertVsPayload@5
displayName: 🏭 Insert VS Payload
inputs:
TeamName: $(TeamName)
TeamEmail: $(TeamEmail)
InsertionPayloadName: $(Build.Repository.Name) $(Build.BuildNumber)
InsertionBuildPolicies: Request Perf DDRITs
InsertionReviewers: $(Build.RequestedFor) # Append `,Your team name` (without quotes)
CustomScriptExecutionCommand: $(Pipeline.Workspace)\CI\VSInsertion-Windows\vs-insertion-script.ps1
AutoCompletePR: true
AutoCompleteMergeStrategy: Squash
ShallowClone: true
${{ if eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9') }}:
ConnectedVSDropServiceName: 'VSEng-VSDrop-MI'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- 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