@@ -25,6 +25,10 @@ parameters:
2525 displayName : Upload API docs
2626 type : boolean
2727 default : false
28+ - name : uploadDependencyTrack
29+ displayName : Upload BOMs to Dependency Track
30+ type : boolean
31+ default : false
2832 - name : forceReleaseTestFilter
2933 displayName : Force to use the release test filters
3034 type : boolean
@@ -93,6 +97,11 @@ stages:
9397 - script : npm ci --no-fund --no-audit --prefer-offline
9498 workingDirectory : src/Umbraco.Web.UI.Client
9599 displayName : Run npm ci (Backoffice)
100+ - powershell : |
101+ npm install --global @cyclonedx/cyclonedx-npm
102+ cyclonedx-npm -o $(Build.ArtifactStagingDirectory)\bom\bom-backoffice.xml --ignore-npm-errors --verbose
103+ displayName: Generate Backoffice UI BOM
104+ workingDirectory: src/Umbraco.Web.UI.Client
96105 - task : gulp@0
97106 displayName : Run gulp build (Backoffice)
98107 inputs :
@@ -106,6 +115,10 @@ stages:
106115 workingDir : src/Umbraco.Web.UI.Login
107116 verbose : false
108117 customCommand : ci
118+ - powershell : |
119+ cyclonedx-npm -o $(Build.ArtifactStagingDirectory)\bom\bom-login.xml --ignore-npm-errors --verbose
120+ displayName: Generate Login UI BOM
121+ workingDirectory: src/Umbraco.Web.UI.Login
109122 - task : npm@1
110123 displayName : Run npm build (Login)
111124 inputs :
@@ -129,6 +142,10 @@ stages:
129142 command : build
130143 projects : $(solution)
131144 arguments : ' --configuration $(buildConfiguration) --no-restore --property:ContinuousIntegrationBuild=true --property:GeneratePackageOnBuild=true --property:PackageOutputPath=$(Build.ArtifactStagingDirectory)/nupkg'
145+ - powershell : |
146+ dotnet tool install --global CycloneDX
147+ dotnet-CycloneDX $(solution) --output $(Build.ArtifactStagingDirectory)/bom --filename bom-dotnet.xml
148+ displayName: 'Generate Backend BOM'
132149 - task : PublishPipelineArtifact@1
133150 displayName : Publish nupkg
134151 inputs :
@@ -139,6 +156,35 @@ stages:
139156 inputs :
140157 targetPath : $(Build.SourcesDirectory)
141158 artifactName : build_output
159+ - task : PublishPipelineArtifact@1
160+ displayName : Publish Backend BOM
161+ inputs :
162+ targetPath : $(Build.ArtifactStagingDirectory)/bom
163+ artifactName : bom-build
164+
165+ - stage : E2E_BOM
166+ displayName : E2E Tests BOM Generation
167+ dependsOn : []
168+ jobs :
169+ - job :
170+ displayName : E2E Generate BOM
171+ pool :
172+ vmImage : " ubuntu-latest"
173+ steps :
174+ - checkout : self
175+ fetchDepth : 500
176+ - template : templates/e2e-install.yml
177+ parameters :
178+ nodeVersion : ${{ variables.nodeVersion }}
179+ npm_config_cache : ${{ variables.npm_config_cache }}
180+ - powershell : |
181+ npm install --global @cyclonedx/cyclonedx-npm
182+ cyclonedx-npm -o $(Build.ArtifactStagingDirectory)/bom/bom-e2e.xml --ignore-npm-errors --verbose
183+ displayName: Generate E2E Tests BOM
184+ workingDirectory: tests/Umbraco.Tests.AcceptanceTest
185+ - publish : $(Build.ArtifactStagingDirectory)/bom
186+ artifact : bom-e2e
187+ displayName : ' Publish E2E BOM'
142188
143189 - stage : Build_Docs
144190 condition : and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.buildApiDocs}}))
@@ -464,37 +510,18 @@ stages:
464510 artifact : nupkg
465511 path : $(Agent.BuildDirectory)/app/nupkg
466512
467- - task : NodeTool@0
468- displayName : Use Node.js $(nodeVersion)
469- retryCountOnTaskFailure : 3
470- inputs :
471- versionSpec : $(nodeVersion)
472-
473513 - task : UseDotNet@2
474514 displayName : Use .NET SDK from global.json
475515 inputs :
476516 useGlobalJson : true
477517
478- - pwsh : |
479- "UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL)
480- UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
481- URL=$(ASPNETCORE_URLS)" | Out-File .env
482- displayName: Generate .env
483- workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
484-
485- # Cache and restore NPM packages
486- - task : Cache@2
487- displayName : Cache NPM packages
488- inputs :
489- key : ' npm_e2e | "$(Agent.OS)" | $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/package-lock.json'
490- restoreKeys : |
491- npm_e2e | "$(Agent.OS)"
492- npm_e2e
493- path : $(npm_config_cache)
494-
495- - script : npm ci --no-fund --no-audit --prefer-offline
496- workingDirectory : $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
497- displayName : Restore NPM packages
518+ - template : templates/e2e-install.yml
519+ parameters :
520+ nodeVersion : $(nodeVersion)
521+ npm_config_cache : $(npm_config_cache)
522+ PlaywrightUserEmail : $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL)
523+ PlaywrightPassword : $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
524+ ASPNETCORE_URLS : $(ASPNETCORE_URLS)
498525
499526 # Build application
500527 - pwsh : |
@@ -755,6 +782,34 @@ stages:
755782 searchFolder : " tests/Umbraco.Tests.AcceptanceTest/results"
756783 testRunTitle : " $(Agent.JobName)"
757784
785+ - stage : Dependency_Track
786+ displayName : Dependency Track
787+ dependsOn :
788+ - Build
789+ - E2E_BOM
790+ condition : and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.uploadDependencyTrack}}))
791+ variables :
792+ # Determine Umbraco version based on whether it's a public release or not. If public release, use major version, else use full NuGet package version.
793+ umbracoVersion : $[ iif(eq(stageDependencies.Build.A.outputs['build.NBGV_PublicRelease'], 'True'), stageDependencies.Build.A.outputs['build.NBGV_VersionMajor'], stageDependencies.Build.A.outputs['build.NBGV_NuGetPackageVersion']) ]
794+ jobs :
795+ - template : templates/dependency-track.yml
796+ parameters :
797+ projectName : " Umbraco-CMS"
798+ umbracoVersion : $(umbracoVersion)
799+ projects :
800+ - name : " Backend"
801+ artifact : " bom-build"
802+ bomFilePath : " bom-dotnet.xml"
803+ - name : " Login"
804+ artifact : " bom-build"
805+ bomFilePath : " bom-login.xml"
806+ - name : " Backoffice"
807+ artifact : " bom-build"
808+ bomFilePath : " bom-backoffice.xml"
809+ - name : " E2E"
810+ artifact : " bom-e2e"
811+ bomFilePath : " bom-e2e.xml"
812+
758813 # ##############################################
759814 # # Release
760815 # ##############################################
0 commit comments