-
Notifications
You must be signed in to change notification settings - Fork 4
Add SBOM manifest generation #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- pwsh: | | ||
$simulateReleaseBuild = $null | ||
Write-Host "SimulateReleaseBuild set to $env:SimulateReleaseBuild" | ||
if (-not([bool]::TryParse($env:SimulateReleaseBuild, [ref] $simulateReleaseBuild))) | ||
{ | ||
throw "SimulateReleaseBuild can only be set to true or false." | ||
} | ||
$isReleaseBuild = $false | ||
if ($env:BuildSourceBranchName -like "release_*" -or $simulateReleaseBuild) | ||
{ | ||
$isReleaseBuild = $true | ||
} | ||
Write-Host "Setting IsReleaseBuild to $isReleaseBuild because SimulateReleaseBuild is $env:SimulateReleaseBuild" | ||
Write-Host "##vso[task.setvariable variable=IsReleaseBuild]$isReleaseBuild" | ||
Write-Host "IsReleaseBuild: $isReleaseBuild" | ||
displayName: Set IsReleaseBuild pipeline variable | ||
env: | ||
SimulateReleaseBuild: $(SimulateReleaseBuild) | ||
|
||
- pwsh: | | ||
Import-Module ".\pipelineUtilities.psm1" -Force | ||
Install-Dotnet | ||
displayName: 'Install .NET 3.1' | ||
|
||
- pwsh: | | ||
Write-Host "IsReleaseBuild set to $env:IsReleaseBuild" | ||
$isReleaseBuild = $false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems we're assigning isReleaseBuild
twice? In the first pwsh
block, we do it based on the branch name and the simulateReleaseBuild
variable. On the last pwsh
block, we do it based on env:IsReleaseBuild
.
What would happen is SimulateReleaseBuild
is true
but env:IsReleaseBuild
were false
? Wouldn't force IsReleaseBuild
to false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite. The intention of SimulateReleaseBuild
is precisely to force the pipeline to emulate behavior as if IsReleaseBuild
were set to true
. There should never be a case following the first pwsh
block where the SimulateReleaseBuild
is true
but IsReleaseBuild
is false
.
For the second pwsh
block, the reason IsReleaseBuild
pipeline variable is propagated to this step as an environment variable is because Linux agents don't always respect using the $(variableName)
notation directly in the pwsh
script, and variable values are not carried over between steps in ADO by default. Instead, we set the pipeline variable in the first pwsh
block with the Write-Host "##vso[task.setvariable variable=IsReleaseBuild]$isReleaseBuild"
statement, and set an environment variable equal to the pipeline variable in the env
block of the second pwsh
block.
SBOMUtilSASUrl: $(SBOMUtilSASUrl) | ||
|
||
- pwsh: | | ||
./test/E2E/Start-E2ETest.ps1 -NoBuild -UseCoreToolsBuildFromIntegrationTests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we ever call this without NoBuild
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, so the Start-E2ETest.ps1
script is intended to be used for both local E2E test runs and in CI. The CI uses the -NoBuild
flag since we have a distinct step dedicated to building the SDK, but it can be omitted for a local test run.
Adds SBOM manifest generation to the CI pipeline. The SBOM will only be generated for release builds or when the user overrides the SimulateReleaseBuild variable on ADO.