Convert the cg-detection pipeline to use 1ES templates (#5275)

This commit is contained in:
Michael Simons 2024-03-15 15:21:51 -05:00 коммит произвёл Logan Bussell false
Родитель fd7e942f68
Коммит c7860c4a9a
3 изменённых файлов: 40 добавлений и 31 удалений

Просмотреть файл

@ -0,0 +1,17 @@
# This job builds all projects in the repository. It is intended to be used for CG purposes.
# The 1ES CG step does not scan artifacts that are built within Dockerfiles therefore they
# need to be built outside of Dockerfiles.
jobs:
- job: BuildProjects
displayName: Build Projects
pool:
name: NetCore1ESPool-Internal
image: 1es-ubuntu-2204
os: linux
steps:
- powershell: >
./eng/common/Install-DotNetSdk.ps1 /usr/share/.dotnet
displayName: Run Dotnet Install Script
- script: >
find . -name '*.csproj' | grep $(cgBuildGrepArgs) | xargs -n 1 /usr/share/.dotnet/dotnet build
displayName: Build Projects

Просмотреть файл

@ -1,17 +0,0 @@
jobs:
- job: Build
pool:
vmImage: $(defaultLinuxAmd64PoolImage)
steps:
- powershell: >
./eng/common/Install-DotNetSdk.ps1 /usr/share/.dotnet
displayName: Run Dotnet Install Script
- task: CodeQL3000Init@0
displayName: CodeQL Initialize
- script: >
find . -name '*.csproj' | grep $(cgBuildGrepArgs) | xargs -n 1 /usr/share/.dotnet/dotnet build
displayName: Build Projects
- task: CodeQL3000Finalize@0
displayName: CodeQL Finalize
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: Component Detection

Просмотреть файл

@ -1,3 +1,5 @@
# This pipelines builds all projects in the repository outside of Dockerfiles so that the artifacts
# can be scanned by SDL steps. SDL steps do not scan artifacts that are built within Dockerfiles.
trigger:
branches:
include:
@ -5,19 +7,26 @@ trigger:
- nightly
pr: none
parameters:
- name: TSAEnabled
displayName: Publish CodeQL results to TSA
type: boolean
default: true
variables:
- template: ../common/templates/variables/codeql.yml
- name: skipComponentGovernanceDetection
value: false
resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
TSAEnabled: ${{ parameters.TSAEnabled }}
- template: ../common/templates/variables/common.yml
- name: cgBuildGrepArgs
value: -v -e 'samples/' -e 'tests/'
jobs:
- template: ../common/templates/jobs/cg-detection.yml
pool:
name: NetCore1ESPool-Internal
image: 1es-windows-2022
os: windows
customBuildTags:
- ES365AIMigrationTooling
stages:
- stage: CgDetection
displayName: CG Detection
jobs:
- template: /eng/common/templates/jobs/cg-build-projects.yml@self