|
| 1 | +# BuildDropPath - The root folder of the drop directory for which the manifest file will be generated. |
| 2 | +# PackageName - The name of the package this SBOM represents. |
| 3 | +# PackageVersion - The version of the package this SBOM represents. |
| 4 | +# ManifestDirPath - The path of the directory where the generated manifest files will be placed |
| 5 | + |
| 6 | +parameters: |
| 7 | + PackageVersion: 7.0.0 |
| 8 | + BuildDropPath: '$(Build.SourcesDirectory)/artifacts' |
| 9 | + PackageName: '.NET' |
| 10 | + ManifestDirPath: $(Build.ArtifactStagingDirectory)/sbom |
| 11 | + sbomContinueOnError: true |
| 12 | + |
| 13 | +steps: |
| 14 | +- task: PowerShell@2 |
| 15 | + displayName: Prep for SBOM generation in (Non-linux) |
| 16 | + condition: or(eq(variables['Agent.Os'], 'Windows_NT'), eq(variables['Agent.Os'], 'Darwin')) |
| 17 | + inputs: |
| 18 | + filePath: ./eng/common/generate-sbom-prep.ps1 |
| 19 | + arguments: ${{parameters.manifestDirPath}} |
| 20 | + |
| 21 | +- script: | |
| 22 | + ./eng/common/generate-sbom-prep.sh ${{parameters.manifestDirPath}} |
| 23 | + displayName: Prep for SBOM generation in (Linux) |
| 24 | + condition: eq(variables['Agent.Os'], 'Linux') |
| 25 | + continueOnError: ${{ parameters.sbomContinueOnError }} |
| 26 | + |
| 27 | +- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 |
| 28 | + displayName: 'Generate SBOM manifest' |
| 29 | + continueOnError: ${{ parameters.sbomContinueOnError }} |
| 30 | + inputs: |
| 31 | + PackageName: ${{ parameters.packageName }} |
| 32 | + BuildDropPath: ${{ parameters.buildDropPath }} |
| 33 | + PackageVersion: ${{ parameters.packageVersion }} |
| 34 | + ManifestDirPath: ${{ parameters.manifestDirPath }} |
| 35 | + |
| 36 | +- task: PublishPipelineArtifact@1 |
| 37 | + displayName: Publish SBOM manifest |
| 38 | + continueOnError: ${{parameters.sbomContinueOnError}} |
| 39 | + inputs: |
| 40 | + targetPath: '${{parameters.manifestDirPath}}' |
| 41 | + artifactName: $(ARTIFACT_NAME) |
| 42 | + |
0 commit comments