Skip to content

Commit

Permalink
chore: migrate to 1ES pipeline templates (#7676)
Browse files Browse the repository at this point in the history
  • Loading branch information
rzhao271 authored Oct 11, 2024
1 parent 4c7b28e commit df02860
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 62 deletions.
29 changes: 14 additions & 15 deletions .pipelines/onebranch.buddy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,32 @@ pr: none

resources:
repositories:
- repository: templates
- repository: 1esPipelines
type: git
name: OneBranch.Pipelines/GovernedTemplates
ref: refs/heads/main
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release

pipelines:
- pipeline: vscode-website-main
source: vscode-website (buddy)
branch: main
trigger: true

variables:
WindowsContainerImage: 'mcr.microsoft.com/windows/servercore:ltsc2019'

extends:
template: v2/OneBranch.NonOfficial.CrossPlat.yml@templates
template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines
parameters:
git:
fetchDepth: 1
lfs: true
retryCount: 3

globalSdl:
sdl:
credscan:
suppressionsFile: $(Build.SourcesDirectory)\.config\CredScanSuppressions.json
suppressionsFile: $(Build.SourcesDirectory)/.config/CredScanSuppressions.json
git:
fetchDepth: 1
lfs: true
retryCount: 3
policheck:
break: true
sourceAnalysisPool: 1es-windows-2022-x64
tsa:
enabled: true

stages:
- template: templates\stages\build-buddy.yml
- template: templates/stages/build-buddy.yml@self
33 changes: 16 additions & 17 deletions .pipelines/onebranch.official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ pr: none

resources:
repositories:
- repository: templates
- repository: 1esPipelines
type: git
name: OneBranch.Pipelines/GovernedTemplates
ref: refs/heads/main
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release

pipelines:
- pipeline: vscode-website-prod
Expand All @@ -25,27 +25,26 @@ resources:
trigger: true

variables:
WindowsContainerImage: 'mcr.microsoft.com/windows/servercore:ltsc2019'
Codeql.enabled: true
Codeql.Enabled: true
Codeql.SourceRoot: $(Pipeline.Workspace)/vscode-website
Codeql.TSAEnabled: true
Codeql.TSAOptionsPath: $(Build.SourcesDirectory)\.config\tsaoptions.json
Codeql.TSAOptionsPath: $(Build.SourcesDirectory)/.config/tsaoptions.json

extends:
template: v2/OneBranch.Official.CrossPlat.yml@templates
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
git:
fetchDepth: 1
lfs: true
retryCount: 3

globalSdl:
asyncSdl:
enabled: false
sdl:
credscan:
suppressionsFile: $(Build.SourcesDirectory)\.config\CredScanSuppressions.json
suppressionsFile: $(Build.SourcesDirectory)/.config/CredScanSuppressions.json
git:
fetchDepth: 1
lfs: true
retryCount: 3
policheck:
break: true
sourceAnalysisPool: 1es-windows-2022-x64
tsa:
enabled: true

stages:
- template: templates\stages\build-official.yml
- template: templates/stages/build-official.yml@self
45 changes: 17 additions & 28 deletions .pipelines/templates/jobs/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ jobs:
- job:
displayName: ${{ parameters.jobDisplayName }}
pool:
type: windows

variables:
ob_outputDirectory: $(Build.ArtifactStagingDirectory)/out
ob_artifactSuffix: ${{ parameters.jobDisplayName }}
ob_git_path: vscode-website/vscode-docs
ob_sdl_codeSignValidation_excludes: -|**\*.js;-|**\*.ps1
name: 1es-windows-2022-x64
os: Windows
templateContext:
outputs:
- output: pipelineArtifact
targetPath: $(Build.ArtifactStagingDirectory)/out
artifactName: drop_Build_${{ parameters.jobDisplayName }}

steps:
- checkout: self
path: vscode-docs

- download: ${{ parameters.artifactName }}
artifact: drop_Build_Linux
displayName: Download ${{ parameters.artifactName }}
Expand All @@ -26,11 +29,14 @@ jobs:
contents: '**'
sourceFolder: $(Pipeline.Workspace)/${{ parameters.artifactName }}/drop_Build_Linux
targetFolder: $(Pipeline.Workspace)/vscode-website
displayName: Copy ${{ parameters.artifactName }}
displayName: Copy ${{ parameters.artifactName }} to vscode-website

- task: CodeQL3000Init@0
displayName: CodeQL Initialize
condition: eq(variables['Codeql.enabled'], 'True')
- task: CopyFiles@2
inputs:
contents: '**'
sourceFolder: $(Pipeline.Workspace)/vscode-docs
targetFolder: $(Pipeline.Workspace)/vscode-website/vscode-docs
displayName: Copy vscode-docs into vscode-website

- task: NodeTool@0
displayName: Install Node via .nvmrc
Expand Down Expand Up @@ -69,27 +75,10 @@ jobs:
displayName: Rebuild Dist From Website
workingDirectory: $(Pipeline.Workspace)/vscode-website

- script: npm install
displayName: Install Dist dependencies
workingDirectory: $(Pipeline.Workspace)/vscode-website/dist

- task: CodeQL3000Finalize@0
displayName: CodeQL Finalize
condition: eq(variables['Codeql.enabled'], 'True')

- task: ArchiveFiles@2
inputs:
rootFolderOrFile: $(Pipeline.Workspace)/vscode-website/dist
archiveType: 'zip'
includeRootFolder: false
archiveFile: $(Build.ArtifactStagingDirectory)/out/website.zip
displayName: Archive complete website

- task: ArchiveFiles@2
inputs:
rootFolderOrFile: $(Pipeline.Workspace)/vscode-website/dist/client/assets
archiveType: 'zip'
includeRootFolder: false
archiveFile: $(Build.ArtifactStagingDirectory)/out/website-assets.zip
displayName: Archive website assets
condition: ${{ eq(parameters.jobDisplayName, 'vscode-site-vnext') }}
2 changes: 1 addition & 1 deletion .pipelines/templates/stages/build-buddy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
stages:
- stage: Build
jobs:
- template: ..\jobs\build.yml
- template: ../jobs/build.yml@self
parameters:
jobDisplayName: vscode-site-vnext
artifactName: vscode-website-main
2 changes: 1 addition & 1 deletion .pipelines/templates/stages/build-official.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
stages:
- stage: Build
jobs:
- template: ..\jobs\build.yml
- template: ../jobs/build.yml@self
parameters:
jobDisplayName: vscode-site-prod
artifactName: vscode-website-prod

0 comments on commit df02860

Please sign in to comment.