-
Notifications
You must be signed in to change notification settings - Fork 350
Expand file tree
/
Copy pathazure-pipelines-insertion.yml
More file actions
160 lines (144 loc) · 5.9 KB
/
azure-pipelines-insertion.yml
File metadata and controls
160 lines (144 loc) · 5.9 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
parameters:
- name: 'ComponentBranchName'
default: 'rel/18.7'
- name: 'CreateDraftPR'
default: 'false'
- name: 'OptionalTitlePrefix'
default: '[Auto Insertion]'
- name: 'VisualStudioBranchName'
default: 'main'
variables:
- group: DotNet-Roslyn-Insertion-Variables
- template: /eng/common/templates-official/variables/pool-providers.yml@self
- name: BuildQueueName
value: 'microsoft-vstest'
- name: ComponentAzdoUri
value: 'https://dev.azure.com/dnceng'
- name: ComponentProjectName
value: 'internal'
- name: ComponentName
value: 'VS Test Platform'
- name: DropPath
value: '/dp=microsoft-vstest/VSSetupArtifacts'
- name: SpecificBuildNumber
value: ''
- name: CherryPick
value: ''
- name: AutoComplete
value: 'true'
- name: ComponentBranchName
value: '${{ parameters.ComponentBranchName }}'
- name: CreateDraftPR
value: '${{ parameters.CreateDraftPR }}'
- name: OptionalTitlePrefix
value: '${{ parameters.OptionalTitlePrefix }}'
- name: VisualStudioBranchName
value: '${{ parameters.VisualStudioBranchName }}'
trigger: none
schedules:
# insert at 1am on monday, wednesday and friday
- cron: 0 1 * * 1,3,5
displayName: Daily midnight insertion to VS
branches:
include:
- rel/18.7
always: true
resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
sdl:
policheck:
enabled: true
tsa:
enabled: true
pool:
name: $(DncEngInternalBuildPool)
image: windows.vs2026preview.scout.amd64
os: windows
settings:
networkIsolationPolicy: Permissive,CFSClean
customBuildTags:
- ES365AIMigrationTooling
stages:
- stage: insert
displayName: Insert
jobs:
- template: /eng/common/templates-official/jobs/jobs.yml@self
parameters:
jobs:
- job: insert
displayName: Insert
pool:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals windows.vs2026preview.scout.amd64
timeoutInMinutes: 90
steps:
- task: PowerShell@2
displayName: 'Install .NET SDK from global.json'
inputs:
targetType: inline
script: |
$globalJson = Get-Content -Raw global.json | ConvertFrom-Json
$version = $globalJson.sdk.version
Write-Host "Installing .NET SDK version $version from global.json"
& eng/common/dotnet-install.ps1 -version $version -runtime ''
- task: AzureCLI@2
displayName: 'Run VS Insertion'
inputs:
azureSubscription: 'DncEng Insertion: Roslyn and Razor'
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
# Install Roslyn insertion tools from the dnceng feed, using --tool-path as a workaround to avoid resetting the process to pick up dotnet tool path changes
$dotnet = "$(Build.SourcesDirectory)\.dotnet\dotnet.exe"
& $dotnet tool install Microsoft.RoslynTools --prerelease --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json --tool-path .
# Acquire dnceng AzDO token via WIF service connection
$dncengToken = az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query accessToken -o tsv
if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($dncengToken)) {
Write-Error 'Failed to acquire Azure DevOps access token via WIF.'
exit 1
}
# Add VS Interactive experiences team (from devdiv) as reviewer
$team = "10a2f33b-3b3d-47a9-a22f-6bb09247bb63"
$insertArgs = @(
"create-insertion"
"--vs-branch", "$(VisualStudioBranchName)"
"--component-branch", "$(ComponentBranchName)"
"--insertion-name", "$(ComponentName)"
"--component-build-queue", "$(BuildQueueName)"
"--component-azdo-uri", "$(ComponentAzdoUri)"
"--component-project", "$(ComponentProjectName)"
"--build-drop-path", "$(DropPath)"
"--insert-corext-packages", "false"
"--insert-devdiv-source-files", "false"
"--title-prefix", "$(OptionalTitlePrefix)"
"--reviewer-guid", $team
"--dnceng-azdo-token", $dncengToken
"--devdiv-azdo-token", "$(dn-bot-devdiv-build-e-code-full-release-e-packaging-r)"
"--ci"
)
if ("$(AutoComplete)" -eq "true") {
$insertArgs += "--set-auto-complete"
}
if ("$(CreateDraftPR)" -eq "true") {
$insertArgs += "--create-draft-pr"
}
if (-not [string]::IsNullOrWhiteSpace("$(SpecificBuildNumber)")) {
$insertArgs += "--specific-build"
$insertArgs += "$(SpecificBuildNumber)"
}
if (-not [string]::IsNullOrWhiteSpace("$(CherryPick)")) {
$insertArgs += "--cherry-pick"
$insertArgs += "$(CherryPick)"
}
"Running: ./roslyn-tools.exe $($insertArgs -join ' ')"
./roslyn-tools.exe @insertArgs
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}