Skip to content

Commit 9a9fe30

Browse files
authored
Merge pull request #2528 from microsoft/dev/lucygramley/updateInsertionPipeline
Updated insertion pipeline to satisfy new reqs
2 parents 7d348c8 + 69e5d24 commit 9a9fe30

18 files changed

+237
-2
lines changed
Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,95 @@
1-
#empty yaml for testing insertion pipeline
1+
trigger: none # We only want to trigger manually or based on resources
2+
pr: none
3+
4+
resources:
5+
repositories:
6+
- repository: MicroBuildTemplate
7+
type: git
8+
name: 1ESPipelineTemplates/MicroBuildTemplate
9+
ref: refs/tags/release
10+
pipelines:
11+
- pipeline: projectSystemBuild
12+
source: NTVS main - nodejstools
13+
tags:
14+
- Real signed
15+
trigger: none
16+
17+
variables:
18+
ContainsVsix: true
19+
20+
extends:
21+
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
22+
parameters:
23+
sdl:
24+
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
25+
stages:
26+
- stage: insertion
27+
jobs:
28+
- job: insertion
29+
displayName: VS insertion
30+
pool: VSEngSS-MicroBuild2022-1ES
31+
templateContext:
32+
outputParentDirectory: $(Pipeline.Workspace)
33+
sdl:
34+
binskim:
35+
analyzeTargetGlob: +:f|$(Pipeline.Workspace)/**;
36+
steps:
37+
- checkout: self
38+
- download: projectSystemBuild
39+
artifact: Variables-Windows
40+
displayName: 🔻 Download Variables-Windows artifact
41+
- powershell: $(Pipeline.Workspace)/projectSystemBuild/Variables-Windows/_define.ps1
42+
displayName: ⚙︝ Set pipeline variables based on artifacts
43+
- powershell: Write-Host "##vso[build.updatebuildnumber]$(Build.BuildNumber)"
44+
displayName: ⚙️ Set pipeline name
45+
- template: /azure-pipelines/release-deployment-prep.yml@self
46+
- powershell: |
47+
$testsDropName = '$(VstsDropNames)' -replace 'Products', 'Tests'
48+
Write-Host "##vso[task.setvariable variable=TESTSDROPNAME]$testsDropName"
49+
displayName: ⚙ Set test drop name
50+
- download: projectSystemBuild
51+
artifact: vsix
52+
displayName: 🔻 Download vsix artifact
53+
- ${{ if eq(variables['ContainsVsix'], 'true') }}:
54+
- task: 1ES.MicroBuildVstsDrop@1
55+
displayName: 🔺 Upload VSTS Drop
56+
inputs:
57+
dropFolder: $(Pipeline.Workspace)/projectSystemBuild/vsix
58+
dropName: $(VstsDropNames)
59+
accessToken: $(System.AccessToken)
60+
skipUploadIfExists: true
61+
- task: MicroBuildInsertVsPayload@5
62+
displayName: 🏭 Insert VS Payload
63+
inputs:
64+
TeamName: Node Tools for Visual Studio
65+
TeamEmail: [email protected]
66+
InsertionPayloadName: Node Tools for Visual Studio build
67+
InsertionReviewers: '$(Build.RequestedFor);JSTSteam;JSTS CTI'
68+
CustomScriptExecutionCommand: '$(Build.SourcesDirectory)/tools/empty-powershell.ps1' #This is intentionally an empty powershell run because MicroBuild needs a CustomScriptExecutionCommand but we don't actually need it
69+
AutoCompletePR: true
70+
AutoCompleteMergeStrategy: Squash
71+
ShallowClone: true
72+
InsertAutoComplete: true
73+
- download: projectSystemBuild
74+
artifact: symbolsToArchive
75+
displayName: 🔻 Download symbolsToArchive artifact
76+
- task: MicroBuildArchiveSymbols@6
77+
displayName: 🔣 Archive symbols to Symweb
78+
inputs:
79+
TeamName: Node Tools for Visual Studio
80+
azureSubscription: 'VSEng-SymbolsUpload' # SERVICE CONNECTION
81+
SymbolsFeatureName: NTVS
82+
SymbolsProject: VS
83+
SymbolsAgentPath: $(Pipeline.Workspace)/projectSystemBuild/symbolsToArchive #$(System.DefaultWorkingDirectory)\NTVS v3\Symbols link: https://dev.azure.com/devdiv/DevDiv/_releaseDefinition?definitionId=300&_a=definition-variables
84+
env:
85+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
86+
87+
- powershell: |
88+
$contentType = 'application/json';
89+
$headers = @{ Authorization = 'Bearer $(System.AccessToken)' };
90+
$rawRequest = @{ daysValid = 365 * 2; definitionId = $(System.DefinitionId); ownerId = 'User:$(Build.RequestedForId)'; protectPipeline = $false; runId = $(Build.BuildId) };
91+
$request = ConvertTo-Json @($rawRequest);
92+
Write-Host $request
93+
$uri = "$(System.CollectionUri)$(System.TeamProject)/_apis/build/retention/leases?api-version=6.0-preview.1";
94+
Invoke-RestMethod -uri $uri -method POST -Headers $headers -ContentType $contentType -Body $request;
95+
displayName: 🗻 Retain inserted builds

azure-pipelines/build.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,17 @@ extends:
7878
- output: pipelineArtifact
7979
displayName: 'Publish Symbols Artifact'
8080
targetPath: $(Build.ArtifactStagingDirectory)\symbols
81-
artifactName: Symbols
81+
artifactName: symbolsToArchive
82+
83+
- output: pipelineArtifact
84+
displayName: 'Publish Artifact: vsix'
85+
targetPath: $(Build.ArtifactStagingDirectory)\vsix
86+
artifactName: vsix
87+
88+
- output: pipelineArtifact
89+
displayName: 'Publish Artifact: Variables-Windows'
90+
targetPath: $(Build.SourcesDirectory)/azure-pipelines/variables
91+
artifactName: Variables-Windows
8292

8393
- output: microBuildVstsDrop
8494
displayName: Upload VSTS Drop
@@ -202,6 +212,30 @@ extends:
202212
SourceFolder: $(Build.ArtifactStagingDirectory)\sbom
203213
Contents: _manifest\**\*.json
204214
TargetFolder: '$(Build.ArtifactStagingDirectory)\raw'
215+
216+
- task: CopyFiles@2
217+
displayName: Copy tools folder for symbols-legacy
218+
inputs:
219+
SourceFolder: tools
220+
TargetFolder: $(Build.ArtifactStagingDirectory)\tools
221+
222+
- task: CopyFiles@2
223+
displayName: Copy VSIX to staging directory
224+
inputs:
225+
SourceFolder: '$(System.DefaultWorkingDirectory)'
226+
Contents: '**\*.vsix'
227+
TargetFolder: '$(Build.ArtifactStagingDirectory)\vsix'
228+
flattenFolders: true
229+
230+
#Variables
231+
- template: azure-pipelines/release-deployment-prep.yml@self
232+
233+
- task: CopyFiles@2
234+
displayName: Copy Variables-Windows files
235+
inputs:
236+
SourceFolder: $(Build.SourcesDirectory)/azure-pipelines/variables
237+
TargetFolder: $(Build.ArtifactStagingDirectory)/$(VSTSDROPNAMES)/azure-pipelines/variables
238+
205239

206240
- task: PublishSymbols@2
207241
displayName: Index Sources and Publish Symbols
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
steps:
2+
- powershell: azure-pipelines/variables/_define.ps1
3+
displayName: ⚙️ Set pipeline variables based on artifacts
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
'Visual Studio - VS Core'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
'\\cpvsbuild\drops\nodejstools\build'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
'true'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
'Request Perf DDRITs'
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
$vstsDropNames = & "$PSScriptRoot\VstsDropNames.ps1"
2+
3+
# $BasePath = "$PSScriptRoot\..\..\Nodejs\Setup\NodejsTools.vsmanproj"
4+
$BasePath = "$PSScriptRoot\..\..\BuildOutput\Release\Setup" #this seemed to work?
5+
6+
if (Test-Path $BasePath) {
7+
$vsmanFiles = @()
8+
Get-ChildItem $BasePath *.vsman -Recurse -File |% {
9+
$version = (Get-Content $_.FullName | ConvertFrom-Json).info.buildVersion
10+
$fn = $_.Name
11+
$vsmanFiles += "$fn=https://vsdrop.corp.microsoft.com/file/v1/$vstsDropNames;$fn"
12+
# $vsmanFiles += "NodeJsTools.vsman=https://vsdrop.corp.microsoft.com/file/v1/$vstsDropNames;$fn"
13+
#NodejsTools.vsman=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/microsoft/nodejstools/$(Build.SourceBranchName)/$(Build.BuildNumber);NodejsTools.vsman
14+
}
15+
16+
[string]::join(',',$vsmanFiles)
17+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
'JSTSteam, JSTS CTI'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This is the default branch of the VS repo that we will use to insert into VS.
2+
'main'

0 commit comments

Comments
 (0)