-
Notifications
You must be signed in to change notification settings - Fork 10k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
505 additions
and
414 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Param( | ||
[Parameter(Mandatory=$true)][string] $ManifestDirPath # Manifest directory where sbom will be placed | ||
) | ||
|
||
Write-Host "Creating dir $ManifestDirPath" | ||
# create directory for sbom manifest to be placed | ||
if (!(Test-Path -path $ManifestDirPath)) | ||
{ | ||
New-Item -ItemType Directory -path $ManifestDirPath | ||
Write-Host "Successfully created directory $ManifestDirPath" | ||
} | ||
else{ | ||
Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." | ||
} | ||
|
||
Write-Host "Updating artifact name" | ||
$artifact_name = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM" -replace '["/:<>\\|?@*"() ]', '_' | ||
Write-Host "Artifact name $artifact_name" | ||
Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$artifact_name" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
source="${BASH_SOURCE[0]}" | ||
|
||
manifest_dir=$1 | ||
|
||
if [ ! -d "$manifest_dir" ] ; then | ||
mkdir -p "$manifest_dir" | ||
echo "Sbom directory created." $manifest_dir | ||
else | ||
Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." | ||
fi | ||
|
||
artifact_name=$SYSTEM_STAGENAME"_"$AGENT_JOBNAME"_SBOM" | ||
echo "Artifact name before : "$artifact_name | ||
# replace all special characters with _, some builds use special characters like : in Agent.Jobname, that is not a permissible name while uploading artifacts. | ||
safe_artifact_name="${artifact_name//["/:<>\\|?@*$" ]/_}" | ||
echo "Artifact name after : "$safe_artifact_name | ||
export ARTIFACT_NAME=$safe_artifact_name | ||
echo "##vso[task.setvariable variable=ARTIFACT_NAME]$safe_artifact_name" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# BuildDropPath - The root folder of the drop directory for which the manifest file will be generated. | ||
# PackageName - The name of the package this SBOM represents. | ||
# PackageVersion - The version of the package this SBOM represents. | ||
# ManifestDirPath - The path of the directory where the generated manifest files will be placed | ||
|
||
parameters: | ||
PackageVersion: 6.0.0 | ||
BuildDropPath: '$(Build.SourcesDirectory)/artifacts' | ||
PackageName: '.NET' | ||
ManifestDirPath: $(Build.ArtifactStagingDirectory)/sbom | ||
sbomContinueOnError: true | ||
|
||
steps: | ||
- task: PowerShell@2 | ||
displayName: Prep for SBOM generation in (Non-linux) | ||
condition: or(eq(variables['Agent.Os'], 'Windows_NT'), eq(variables['Agent.Os'], 'Darwin')) | ||
inputs: | ||
filePath: ./eng/common/generate-sbom-prep.ps1 | ||
arguments: ${{parameters.manifestDirPath}} | ||
|
||
# Chmodding is a workaround for https://github.com/dotnet/arcade/issues/8461 | ||
- script: | | ||
chmod +x ./eng/common/generate-sbom-prep.sh | ||
./eng/common/generate-sbom-prep.sh ${{parameters.manifestDirPath}} | ||
displayName: Prep for SBOM generation in (Linux) | ||
condition: eq(variables['Agent.Os'], 'Linux') | ||
continueOnError: ${{ parameters.sbomContinueOnError }} | ||
|
||
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 | ||
displayName: 'Generate SBOM manifest' | ||
continueOnError: ${{ parameters.sbomContinueOnError }} | ||
inputs: | ||
PackageName: ${{ parameters.packageName }} | ||
BuildDropPath: ${{ parameters.buildDropPath }} | ||
PackageVersion: ${{ parameters.packageVersion }} | ||
ManifestDirPath: ${{ parameters.manifestDirPath }} | ||
|
||
- task: PublishPipelineArtifact@1 | ||
displayName: Publish SBOM manifest | ||
continueOnError: ${{parameters.sbomContinueOnError}} | ||
inputs: | ||
targetPath: '${{parameters.manifestDirPath}}' | ||
artifactName: $(ARTIFACT_NAME) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,6 @@ | |
}, | ||
"resolutions": { | ||
"ansi-regex": "5.0.1", | ||
"url-parse": ">=1.5.6" | ||
"url-parse": ">=1.5.8" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters