From bbd60ca21cba77fae1950059da5ca4306bbd4059 Mon Sep 17 00:00:00 2001 From: James Dawson Date: Wed, 2 Aug 2023 14:48:35 +0100 Subject: [PATCH] Remove customisations now part of the scripted build --- build.ps1 | 95 +------------------------------------------------------ 1 file changed, 1 insertion(+), 94 deletions(-) diff --git a/build.ps1 b/build.ps1 index 0d52c8d..de6d189 100644 --- a/build.ps1 +++ b/build.ps1 @@ -169,102 +169,9 @@ task PostTest {} task PreTestReport {} task PostTestReport {} task PreAnalysis {} -task PostAnalysis RunSBOMAnalysis +task PostAnalysis {} task PrePackage {} task PostPackage {} task PrePublish {} task PostPublish {} task RunLast {} - -# task RunSBOMAnalysis -If { $SolutionToBuild } RunCovenantTool,{ -# if (!(Get-Module Az.Storage -ListAvailable)){ -# Install-Module Az.Storage -Scope CurrentUser -Repository PSGallery -Force -Verbose -# } - -# $AnalysisOutputContainerName = "data" -# $AnalysisOutputStorageAccountName = "endsynapsedatalake" -# # 1. Download JSON ruleset -# $uri = "https://{0}.blob.core.windows.net/{1}/{2}" -f $AnalysisOutputStorageAccountName, -# $AnalysisOutputContainerName, -# "openchain/license_rules" - -# $authUri = exec {& az storage blob generate-sas ` -# --auth-mode login ` -# --as-user ` -# --https-only ` -# --account-name $AnalysisOutputStorageAccountName ` -# --blob-url $uri ` -# --permissions re ` -# --start (Get-Date).ToUniversalTime().ToString("yyyy-M-d'T'H:m'Z'") ` -# --expiry (Get-Date).AddMinutes(10).ToUniversalTime().ToString("yyyy-M-d'T'H:m'Z'") ` -# --full-uri ` -# -o tsv} -# Write-Host $authUri - -# $blobs = Get-AzureStorageBlob -Container $AnalysisOutputContainerName -Context $destination_path - -# $analysisFilesLocation = '.analysis' -# New-Item -ItemType Directory $analysisFilesLocation | Out-Null -# Get-AzStorageBlobContent -Destination "$($analysisFilesLocation)/" -absoluteuri $authUri -Force | fl - -# # Find latest version released on GitHub -# $env:GH_TOKEN = $env:CUSTOM_GITHUB_TOKEN -# $latestVersion = exec { gh release list -R endjin/endjin-sbom-analyser --limit 1 } | -# ConvertFrom-Csv -Header title,type,"tag name",published -Delimiter `t | -# Select-Object -ExpandProperty "tag name" - -# if (!$latestVersion) { -# throw "Unable to determine the latest version of the Python tool" -# } -# Write-Host $latestVersion - -# $DownloadFileName = "sbom_analyser-$($latestVersion)-py3-none-any.whl" -# Write-Host "Downloading latest release of SBOM Analyser, version" $latestVersion -# exec { & gh release download -R "endjin/endjin-sbom-analyser" -p $DownloadFileName -D $analysisFilesLocation} - -# exec { -# pip install poetry -# pip install (Join-Path $analysisFilesLocation $DownloadFileName) -# $sbomPath = $covenantJsonOutputFile -# Write-Host $sbomPath -# $jsonPath = Get-ChildItem -path "$($analysisFilesLocation)/openchain/license_rules/*.json" -# Write-Host $jsonPath -# generate_sbom_score $sbomPath $jsonPath -# } - -# $summarisedContent = Get-Content 'sbom_analysis_summarised_scores.csv' | ConvertFrom-Csv - -# function Write-Components { - -# param ( -# $fileName, -# $sum, -# $type -# ) - -# $components = Import-Csv $fileName | Select-Object -Property name, license -# $componentsHashtable = @{} -# $components | ForEach-Object { -# if($_.License -eq ""){ -# $componentsHashtable[$_.Name] = "Unspecified" -# } -# else{ -# $componentsHashtable[$_.Name] = $_.License -# } -# } -# $componentsString = "" -# foreach ($row in $componentsHashtable.GetEnumerator()){ -# $componentsString += "$($row.Name) : $($row.Value)`n" -# } - -# $content = "There are $($sum) $($type) components in this build, please review the $($fileName) and make appropriate changes `n$($componentsString)" -# return $content - -# } -# if ($summarisedContent.Unknown -gt 0){ -# Write-Warning (Write-Components -fileName 'sbom_analysis_unknown_components.csv' -sum $summarisedContent.Unknown -type 'unknown') -# } -# if ($summarisedContent.Rejected -gt 0){ -# throw Write-Components -fileName 'sbom_analysis_rejected_components.csv' -sum $summarisedContent.Rejected -type 'rejected' -# } -# } \ No newline at end of file