Skip to content

Commit

Permalink
Update azure pipeline file to use new 1ES pipeline template
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkticehurst committed Apr 12, 2024
1 parent a1f078e commit 3fc6115
Showing 1 changed file with 84 additions and 89 deletions.
173 changes: 84 additions & 89 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,97 +1,92 @@
pr:
branches:
include:
- main

branches:
include:
- main
variables:
Codeql.Enabled: true

stages:
Codeql.Enabled: true
resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: windows-2022
os: windows
customBuildTags:
- ES365AIMigrationTooling-BulkMigrated
stages:
- stage: security_compliance
displayName: 'Security & Compliance'
pool:
vmImage: 'windows-latest'
jobs:
- job: compliance
steps:
- task: PoliCheck@1
displayName: 'Run PoliCheck 🌎'
inputs:
inputType: 'Basic'
targetType: 'F'
targetArgument: '$(Build.SourcesDirectory)'
result: 'PoliCheck.xml'
optionsXS: 1
optionsPE: 1
optionsUEPATH: '$(Build.SourcesDirectory)/policheck/UserExclusion.xml'
- task: PublishBuildArtifacts@1
displayName: 'Create log artifact'
inputs:
pathToPublish: '..\_sdt\logs\PoliCheck\PoliCheck.xml'
artifactName: 'PoliCheck'

- job: security
steps:
- task: ESLint@1
displayName: 'Guardian: ESLint 🛡'
inputs:
Configuration: 'recommended'
TargetType: 'eslint'
TargetsESLint: |
$(Build.SourcesDirectory)/**/*.ts
ErrorLevel: 'warn'

- job: compliance
templateContext:
outputs:
- output: pipelineArtifact
displayName: 'Create log artifact'
targetPath: '..\_sdt\logs\PoliCheck\PoliCheck.xml'
artifactName: 'PoliCheck'
steps:
- task: PoliCheck@1
displayName: "Run PoliCheck"
inputs:
inputType: 'Basic'
targetType: 'F'
targetArgument: '$(Build.SourcesDirectory)'
result: 'PoliCheck.xml'
optionsXS: 1
optionsPE: 1
optionsUEPATH: '$(Build.SourcesDirectory)/policheck/UserExclusion.xml'
- job: security
steps:
- task: ESLint@1
displayName: "Guardian: ESLint"
inputs:
Configuration: 'recommended'
TargetType: 'eslint'
TargetsESLint: |
$(Build.SourcesDirectory)/**/*.ts
ErrorLevel: 'warn'
- stage: build_lint
displayName: 'Build & Lint'
pool:
vmImage: 'ubuntu-latest'
jobs:
- job: lint
timeoutInMinutes: 10
steps:
- task: NodeTool@0
displayName: 'Setup Node 💾'
inputs:
versionSpec: '18.x'

- script: npm install
displayName: 'Install Dependencies 📥'

- script: npm run lint
displayName: 'Run Lint Check 🔍'

- script: npm run fmt
displayName: 'Run Format Check 🌸'

- job: build
timeoutInMinutes: 10
steps:
- task: NodeTool@0
displayName: 'Setup Node 💾'
inputs:
versionSpec: '18.x'

- script: npm install
displayName: 'Install Dependencies 📥'

- script: npm run build
displayName: 'Build Toolkit 🏗'

- task: CopyFiles@2
displayName: 'Copy to Staging 📂'
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)/dist'
Contents: |
**/*
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
displayName: 'Generate Manifest 🧾'
inputs:
BuildDropPath: '$(Build.ArtifactStagingDirectory)'
PackageName: 'Webview UI Toolkit for Visual Studio Code'

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts 📦'
inputs:
ArtifactName: 'drop'
- job: lint
timeoutInMinutes: 10
steps:
- task: NodeTool@0
displayName: "Setup Node"
inputs:
versionSpec: '18.x'
- script: npm install
displayName: "Install Dependencies"
- script: npm run lint
displayName: "Run Lint Check"
- script: npm run fmt
displayName: "Run Format Check"
- job: build
timeoutInMinutes: 10
templateContext:
outputs:
- output: pipelineArtifact
displayName: "Publish Artifacts"
artifactName: 'drop'
steps:
- task: NodeTool@0
displayName: "Setup Node"
inputs:
versionSpec: '18.x'
- script: npm install
displayName: "Install Dependencies"
- script: npm run build
displayName: "Build Toolkit"
- task: CopyFiles@2
displayName: "Copy to Staging"
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)/dist'
Contents: |
**/*
TargetFolder: '$(Build.ArtifactStagingDirectory)'

0 comments on commit 3fc6115

Please sign in to comment.