| 1 |
parameters: |
| 2 |
enable: 'false' # Whether the SDL validation job should execute or not |
| 3 |
overrideParameters: '' # Optional: to override values for parameters. |
| 4 |
additionalParameters: '' # Optional: parameters that need user specific values eg: '-SourceToolsList @("abc","def") -ArtifactToolsList @("ghi","jkl")' |
| 5 |
# There is some sort of bug (has been reported) in Azure DevOps where if this parameter is named |
| 6 |
# 'continueOnError', the parameter value is not correctly picked up. |
| 7 |
# This can also be remedied by the caller (post-build.yml) if it does not use a nested parameter |
| 8 |
sdlContinueOnError: false # optional: determines whether to continue the build if the step errors; |
| 9 |
dependsOn: '' # Optional: dependencies of the job |
| 10 |
artifactNames: '' # Optional: patterns supplied to DownloadBuildArtifacts |
| 11 |
# Usage: |
| 12 |
# artifactNames: |
| 13 |
# - 'BlobArtifacts' |
| 14 |
# - 'Artifacts_Windows_NT_Release' |
| 15 |
|
| 16 |
jobs: |
| 17 |
- job: Run_SDL |
| 18 |
dependsOn: ${{ parameters.dependsOn }} |
| 19 |
displayName: Run SDL tool |
| 20 |
condition: eq( ${{ parameters.enable }}, 'true') |
| 21 |
variables: |
| 22 |
- group: DotNet-VSTS-Bot |
| 23 |
- name: AzDOProjectName |
| 24 |
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOProjectName'] ] |
| 25 |
- name: AzDOPipelineId |
| 26 |
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOPipelineId'] ] |
| 27 |
- name: AzDOBuildId |
| 28 |
value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.AzDOBuildId'] ] |
| 29 |
pool: |
| 30 |
name: Hosted VS2017 |
| 31 |
steps: |
| 32 |
- checkout: self |
| 33 |
clean: true |
| 34 |
- ${{ if ne(parameters.artifactNames, '') }}: |
| 35 |
- ${{ each artifactName in parameters.artifactNames }}: |
| 36 |
- task: DownloadBuildArtifacts@0 |
| 37 |
displayName: Download Build Artifacts |
| 38 |
inputs: |
| 39 |
buildType: specific |
| 40 |
buildVersionToDownload: specific |
| 41 |
project: $(AzDOProjectName) |
| 42 |
pipeline: $(AzDOPipelineId) |
| 43 |
buildId: $(AzDOBuildId) |
| 44 |
artifactName: ${{ artifactName }} |
| 45 |
downloadPath: $(Build.ArtifactStagingDirectory)\artifacts |
| 46 |
- ${{ if eq(parameters.artifactNames, '') }}: |
| 47 |
- task: DownloadBuildArtifacts@0 |
| 48 |
displayName: Download Build Artifacts |
| 49 |
inputs: |
| 50 |
buildType: specific |
| 51 |
buildVersionToDownload: specific |
| 52 |
project: $(AzDOProjectName) |
| 53 |
pipeline: $(AzDOPipelineId) |
| 54 |
buildId: $(AzDOBuildId) |
| 55 |
downloadType: specific files |
| 56 |
itemPattern: "**" |
| 57 |
downloadPath: $(Build.ArtifactStagingDirectory)\artifacts |
| 58 |
- powershell: eng/common/sdl/extract-artifact-packages.ps1 |
| 59 |
-InputPath $(Build.ArtifactStagingDirectory)\artifacts\BlobArtifacts |
| 60 |
-ExtractPath $(Build.ArtifactStagingDirectory)\artifacts\BlobArtifacts |
| 61 |
displayName: Extract Blob Artifacts |
| 62 |
continueOnError: ${{ parameters.sdlContinueOnError }} |
| 63 |
- powershell: eng/common/sdl/extract-artifact-packages.ps1 |
| 64 |
-InputPath $(Build.ArtifactStagingDirectory)\artifacts\PackageArtifacts |
| 65 |
-ExtractPath $(Build.ArtifactStagingDirectory)\artifacts\PackageArtifacts |
| 66 |
displayName: Extract Package Artifacts |
| 67 |
continueOnError: ${{ parameters.sdlContinueOnError }} |
| 68 |
- task: NuGetToolInstaller@1 |
| 69 |
displayName: 'Install NuGet.exe' |
| 70 |
- task: NuGetCommand@2 |
| 71 |
displayName: 'Install Guardian' |
| 72 |
inputs: |
| 73 |
restoreSolution: $(Build.SourcesDirectory)\eng\common\sdl\packages.config |
| 74 |
feedsToUse: config |
| 75 |
nugetConfigPath: $(Build.SourcesDirectory)\eng\common\sdl\NuGet.config |
| 76 |
externalFeedCredentials: GuardianConnect |
| 77 |
restoreDirectory: $(Build.SourcesDirectory)\.packages |
| 78 |
- ${{ if ne(parameters.overrideParameters, '') }}: |
| 79 |
- powershell: eng/common/sdl/execute-all-sdl-tools.ps1 ${{ parameters.overrideParameters }} |
| 80 |
displayName: Execute SDL |
| 81 |
continueOnError: ${{ parameters.sdlContinueOnError }} |
| 82 |
- ${{ if eq(parameters.overrideParameters, '') }}: |
| 83 |
- powershell: eng/common/sdl/execute-all-sdl-tools.ps1 |
| 84 |
-GuardianPackageName Microsoft.Guardian.Cli.0.7.2 |
| 85 |
-NugetPackageDirectory $(Build.SourcesDirectory)\.packages |
| 86 |
-AzureDevOpsAccessToken $(dn-bot-dotnet-build-rw-code-rw) |
| 87 |
${{ parameters.additionalParameters }} |
| 88 |
displayName: Execute SDL |
| 89 |
continueOnError: ${{ parameters.sdlContinueOnError }} |