2022-03-09 00:55:29 +00:00
|
|
|
Param(
|
|
|
|
[Parameter(Mandatory=$true)][string] $ManifestDirPath # Manifest directory where sbom will be placed
|
|
|
|
)
|
|
|
|
|
2022-08-12 17:57:30 +00:00
|
|
|
. $PSScriptRoot\pipeline-logging-functions.ps1
|
|
|
|
|
2022-03-09 00:55:29 +00:00
|
|
|
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"
|