Skip to content

Commit

Permalink
Remove customisations now part of the scripted build
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesDawson committed Aug 2, 2023
1 parent 4f2ba2e commit bbd60ca
Showing 1 changed file with 1 addition and 94 deletions.
95 changes: 1 addition & 94 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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'
# }
# }

0 comments on commit bbd60ca

Please sign in to comment.