2019-06-20 12:30:36 +00:00
|
|
|
parameters:
|
2020-01-30 13:35:10 +00:00
|
|
|
enable: 'false' # Whether the SDL validation job should execute or not
|
2019-06-20 12:30:36 +00:00
|
|
|
overrideParameters: '' # Optional: to override values for parameters.
|
|
|
|
additionalParameters: '' # Optional: parameters that need user specific values eg: '-SourceToolsList @("abc","def") -ArtifactToolsList @("ghi","jkl")'
|
2021-07-15 14:32:48 +00:00
|
|
|
# Optional: if specified, restore and use this version of Guardian instead of the default.
|
|
|
|
overrideGuardianVersion: ''
|
|
|
|
# Optional: if true, publish the '.gdn' folder as a pipeline artifact. This can help with in-depth
|
|
|
|
# diagnosis of problems with specific tool configurations.
|
|
|
|
publishGuardianDirectoryToPipeline: false
|
|
|
|
# The script to run to execute all SDL tools. Use this if you want to use a script to define SDL
|
|
|
|
# parameters rather than relying on YAML. It may be better to use a local script, because you can
|
|
|
|
# reproduce results locally without piecing together a command based on the YAML.
|
|
|
|
executeAllSdlToolsScript: 'eng/common/sdl/execute-all-sdl-tools.ps1'
|
2019-08-30 12:32:56 +00:00
|
|
|
# There is some sort of bug (has been reported) in Azure DevOps where if this parameter is named
|
|
|
|
# 'continueOnError', the parameter value is not correctly picked up.
|
|
|
|
# This can also be remedied by the caller (post-build.yml) if it does not use a nested parameter
|
|
|
|
sdlContinueOnError: false # optional: determines whether to continue the build if the step errors;
|
2021-07-15 14:32:48 +00:00
|
|
|
# optional: determines if build artifacts should be downloaded.
|
|
|
|
downloadArtifacts: true
|
|
|
|
# optional: determines if this job should search the directory of downloaded artifacts for
|
|
|
|
# 'tar.gz' and 'zip' archive files and extract them before running SDL validation tasks.
|
|
|
|
extractArchiveArtifacts: false
|
2019-06-20 12:30:36 +00:00
|
|
|
dependsOn: '' # Optional: dependencies of the job
|
2019-11-09 13:42:32 +00:00
|
|
|
artifactNames: '' # Optional: patterns supplied to DownloadBuildArtifacts
|
|
|
|
# Usage:
|
|
|
|
# artifactNames:
|
|
|
|
# - 'BlobArtifacts'
|
|
|
|
# - 'Artifacts_Windows_NT_Release'
|
2021-07-15 14:32:48 +00:00
|
|
|
# Optional: download a list of pipeline artifacts. 'downloadArtifacts' controls build artifacts,
|
|
|
|
# not pipeline artifacts, so doesn't affect the use of this parameter.
|
|
|
|
pipelineArtifactNames: []
|
2019-06-20 12:30:36 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
- job: Run_SDL
|
|
|
|
dependsOn: ${{ parameters.dependsOn }}
|
|
|
|
displayName: Run SDL tool
|
2020-01-30 13:35:10 +00:00
|
|
|
condition: eq( ${{ parameters.enable }}, 'true')
|
2019-06-20 12:30:36 +00:00
|
|
|
variables:
|
|
|
|
- group: DotNet-VSTS-Bot
|
2020-01-30 13:35:10 +00:00
|
|
|
- name: AzDOProjectName
|
2021-07-15 14:32:48 +00:00
|
|
|
value: ${{ parameters.AzDOProjectName }}
|
2020-01-30 13:35:10 +00:00
|
|
|
- name: AzDOPipelineId
|
2021-07-15 14:32:48 +00:00
|
|
|
value: ${{ parameters.AzDOPipelineId }}
|
2020-01-30 13:35:10 +00:00
|
|
|
- name: AzDOBuildId
|
2021-07-15 14:32:48 +00:00
|
|
|
value: ${{ parameters.AzDOBuildId }}
|
2022-03-10 18:38:02 +00:00
|
|
|
- template: /eng/common/templates/variables/sdl-variables.yml
|
2021-07-15 14:32:48 +00:00
|
|
|
- name: GuardianVersion
|
|
|
|
value: ${{ coalesce(parameters.overrideGuardianVersion, '$(DefaultGuardianVersion)') }}
|
2019-08-08 12:54:37 +00:00
|
|
|
pool:
|
2022-02-03 17:48:52 +00:00
|
|
|
# We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com)
|
|
|
|
${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
|
|
|
|
name: VSEngSS-MicroBuild2022-1ES
|
|
|
|
demands: Cmd
|
|
|
|
# If it's not devdiv, it's dnceng
|
|
|
|
${{ if ne(variables['System.TeamProject'], 'DevDiv') }}:
|
|
|
|
name: NetCore1ESPool-Internal
|
|
|
|
demands: ImageOverride -equals Build.Server.Amd64.VS2019
|
2019-06-20 12:30:36 +00:00
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
clean: true
|
2021-07-15 14:32:48 +00:00
|
|
|
|
2022-02-03 17:48:52 +00:00
|
|
|
- template: /eng/common/templates/post-build/setup-maestro-vars.yml
|
|
|
|
|
2020-04-24 17:34:25 +00:00
|
|
|
- ${{ if ne(parameters.downloadArtifacts, 'false')}}:
|
|
|
|
- ${{ if ne(parameters.artifactNames, '') }}:
|
|
|
|
- ${{ each artifactName in parameters.artifactNames }}:
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
displayName: Download Build Artifacts
|
|
|
|
inputs:
|
|
|
|
buildType: specific
|
|
|
|
buildVersionToDownload: specific
|
|
|
|
project: $(AzDOProjectName)
|
|
|
|
pipeline: $(AzDOPipelineId)
|
|
|
|
buildId: $(AzDOBuildId)
|
|
|
|
artifactName: ${{ artifactName }}
|
|
|
|
downloadPath: $(Build.ArtifactStagingDirectory)\artifacts
|
2021-03-11 13:55:56 +00:00
|
|
|
checkDownloadedFiles: true
|
2020-04-24 17:34:25 +00:00
|
|
|
- ${{ if eq(parameters.artifactNames, '') }}:
|
2019-11-09 13:42:32 +00:00
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
displayName: Download Build Artifacts
|
|
|
|
inputs:
|
2020-01-30 13:35:10 +00:00
|
|
|
buildType: specific
|
|
|
|
buildVersionToDownload: specific
|
|
|
|
project: $(AzDOProjectName)
|
|
|
|
pipeline: $(AzDOPipelineId)
|
|
|
|
buildId: $(AzDOBuildId)
|
2020-04-24 17:34:25 +00:00
|
|
|
downloadType: specific files
|
|
|
|
itemPattern: "**"
|
2019-11-09 13:42:32 +00:00
|
|
|
downloadPath: $(Build.ArtifactStagingDirectory)\artifacts
|
2021-03-11 13:55:56 +00:00
|
|
|
checkDownloadedFiles: true
|
2021-07-15 14:32:48 +00:00
|
|
|
|
|
|
|
- ${{ each artifactName in parameters.pipelineArtifactNames }}:
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
displayName: Download Pipeline Artifacts
|
|
|
|
inputs:
|
|
|
|
buildType: specific
|
|
|
|
buildVersionToDownload: specific
|
|
|
|
project: $(AzDOProjectName)
|
|
|
|
pipeline: $(AzDOPipelineId)
|
|
|
|
buildId: $(AzDOBuildId)
|
|
|
|
artifactName: ${{ artifactName }}
|
|
|
|
downloadPath: $(Build.ArtifactStagingDirectory)\artifacts
|
|
|
|
checkDownloadedFiles: true
|
|
|
|
|
2019-06-28 13:15:43 +00:00
|
|
|
- powershell: eng/common/sdl/extract-artifact-packages.ps1
|
2019-10-24 22:05:36 +00:00
|
|
|
-InputPath $(Build.ArtifactStagingDirectory)\artifacts\BlobArtifacts
|
|
|
|
-ExtractPath $(Build.ArtifactStagingDirectory)\artifacts\BlobArtifacts
|
2019-06-28 13:15:43 +00:00
|
|
|
displayName: Extract Blob Artifacts
|
2019-08-30 12:32:56 +00:00
|
|
|
continueOnError: ${{ parameters.sdlContinueOnError }}
|
2021-07-15 14:32:48 +00:00
|
|
|
|
2019-06-28 13:15:43 +00:00
|
|
|
- powershell: eng/common/sdl/extract-artifact-packages.ps1
|
2019-10-24 22:05:36 +00:00
|
|
|
-InputPath $(Build.ArtifactStagingDirectory)\artifacts\PackageArtifacts
|
|
|
|
-ExtractPath $(Build.ArtifactStagingDirectory)\artifacts\PackageArtifacts
|
2019-06-28 13:15:43 +00:00
|
|
|
displayName: Extract Package Artifacts
|
2019-08-30 12:32:56 +00:00
|
|
|
continueOnError: ${{ parameters.sdlContinueOnError }}
|
2021-07-15 14:32:48 +00:00
|
|
|
|
|
|
|
- ${{ if ne(parameters.extractArchiveArtifacts, 'false') }}:
|
|
|
|
- powershell: eng/common/sdl/extract-artifact-archives.ps1
|
|
|
|
-InputPath $(Build.ArtifactStagingDirectory)\artifacts
|
|
|
|
-ExtractPath $(Build.ArtifactStagingDirectory)\artifacts
|
|
|
|
displayName: Extract Archive Artifacts
|
|
|
|
continueOnError: ${{ parameters.sdlContinueOnError }}
|
|
|
|
|
2022-03-10 18:38:02 +00:00
|
|
|
- template: /eng/common/templates/steps/execute-sdl.yml
|
|
|
|
parameters:
|
|
|
|
overrideGuardianVersion: ${{ parameters.overrideGuardianVersion }}
|
|
|
|
executeAllSdlToolsScript: ${{ parameters.executeAllSdlToolsScript }}
|
|
|
|
overrideParameters: ${{ parameters.overrideParameters }}
|
|
|
|
additionalParameters: ${{ parameters.additionalParameters }}
|
|
|
|
publishGuardianDirectoryToPipeline: ${{ parameters.publishGuardianDirectoryToPipeline }}
|
|
|
|
sdlContinueOnError: ${{ parameters.sdlContinueOnError }}
|