mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-11 03:57:29 +00:00
[Ubuntu] Update documentation generation to use shared software report module (#6823)
* Create ubuntu-report.yml * Update ubuntu-report.yml * Update ubuntu-report.yml * Update Common.Helpers.psm1 * Update ubuntu-report.yml * Update ubuntu-report.yml * Update SoftwareReport.Generator.ps1 * Update ubuntu-report.yml * Update ubuntu-report.yml * env vars * Implement language and runtime * Add package management section * fix typo * fix typo * add projectManagement and tools * fix some tools * add CLI tools, Java, PHP Tools, Haskell Tools, Rust Tools, Browsers, .NET Core * fix typo * more changes * fix typo * fix typo * fix typo * change templates * fix toolset * Update Ubuntu2004 and 2204 templates * fix cargo * fix tiny nitpicks * Fix AddToolVersionsList * Remove unused methods * Fix contructor
This commit is contained in:
@@ -1,66 +1,61 @@
|
||||
function Get-ChromeVersion {
|
||||
$googleChromeVersion = google-chrome --version | Take-OutputPart -Part 2
|
||||
return "Google Chrome $googleChromeVersion"
|
||||
return $googleChromeVersion
|
||||
}
|
||||
|
||||
function Get-ChromeDriverVersion {
|
||||
$chromeDriverVersion = chromedriver --version | Take-OutputPart -Part 1
|
||||
return "ChromeDriver $chromeDriverVersion"
|
||||
return $chromeDriverVersion
|
||||
}
|
||||
|
||||
function Get-FirefoxVersion {
|
||||
$firefoxVersion = firefox --version
|
||||
return "$firefoxVersion"
|
||||
$firefoxVersion = $(firefox --version) | Take-OutputPart -Part 2
|
||||
return $firefoxVersion
|
||||
}
|
||||
|
||||
function Get-GeckodriverVersion {
|
||||
$geckodriverVersion = geckodriver --version | Select-Object -First 1 | Take-OutputPart -Part 1
|
||||
return "Geckodriver $geckodriverVersion"
|
||||
return $geckodriverVersion
|
||||
}
|
||||
|
||||
function Get-ChromiumVersion {
|
||||
$chromiumVersion = chromium-browser --version | Take-OutputPart -Part 0,1
|
||||
$chromiumVersion = chromium-browser --version | Take-OutputPart -Part 1
|
||||
return $chromiumVersion
|
||||
}
|
||||
|
||||
function Get-EdgeVersion {
|
||||
$edgeVersion = (microsoft-edge --version).trim()
|
||||
return "$edgeVersion"
|
||||
$edgeVersion = (microsoft-edge --version).Trim() | Take-OutputPart -Part 2
|
||||
return $edgeVersion
|
||||
}
|
||||
|
||||
function Get-EdgeDriverVersion {
|
||||
$edgeDriverVersion = msedgedriver --version | Take-OutputPart -Part 0,1,2,3
|
||||
$edgeDriverVersion = msedgedriver --version | Take-OutputPart -Part 3
|
||||
return $edgeDriverVersion
|
||||
}
|
||||
|
||||
function Get-SeleniumVersion {
|
||||
$seleniumBinaryName = Get-ToolsetValue "selenium.binary_name"
|
||||
$fullSeleniumVersion = (Get-ChildItem "/usr/share/java/${seleniumBinaryName}-*").Name -replace "${seleniumBinaryName}-"
|
||||
return "Selenium server $fullSeleniumVersion"
|
||||
return $fullSeleniumVersion
|
||||
}
|
||||
|
||||
function Build-BrowserWebdriversEnvironmentTable {
|
||||
return @(
|
||||
@{
|
||||
[PSCustomObject] @{
|
||||
"Name" = "CHROMEWEBDRIVER"
|
||||
"Value" = $env:CHROMEWEBDRIVER
|
||||
},
|
||||
@{
|
||||
[PSCustomObject] @{
|
||||
"Name" = "EDGEWEBDRIVER"
|
||||
"Value" = $env:EDGEWEBDRIVER
|
||||
},
|
||||
@{
|
||||
[PSCustomObject] @{
|
||||
"Name" = "GECKOWEBDRIVER"
|
||||
"Value" = $env:GECKOWEBDRIVER
|
||||
},
|
||||
@{
|
||||
[PSCustomObject] @{
|
||||
"Name" = "SELENIUM_JAR_PATH"
|
||||
"Value" = $env:SELENIUM_JAR_PATH
|
||||
}
|
||||
) | ForEach-Object {
|
||||
[PSCustomObject] @{
|
||||
"Name" = $_.Name
|
||||
"Value" = $_.Value
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -26,25 +26,4 @@ function Get-ToolcacheNodeVersions {
|
||||
function Get-ToolcacheGoVersions {
|
||||
$toolcachePath = Join-Path $env:AGENT_TOOLSDIRECTORY "go"
|
||||
return Get-ChildItem $toolcachePath -Name | Sort-Object { [Version]$_ }
|
||||
}
|
||||
|
||||
function Build-CachedToolsSection {
|
||||
$output = ""
|
||||
|
||||
$output += New-MDHeader "Go" -Level 4
|
||||
$output += New-MDList -Lines (Get-ToolcacheGoVersions) -Style Unordered
|
||||
|
||||
$output += New-MDHeader "Node.js" -Level 4
|
||||
$output += New-MDList -Lines (Get-ToolcacheNodeVersions) -Style Unordered
|
||||
|
||||
$output += New-MDHeader "Python" -Level 4
|
||||
$output += New-MDList -Lines (Get-ToolcachePythonVersions) -Style Unordered
|
||||
|
||||
$output += New-MDHeader "PyPy" -Level 4
|
||||
$output += New-MDList -Lines (Get-ToolcachePyPyVersions) -Style Unordered
|
||||
|
||||
$output += New-MDHeader "Ruby" -Level 4
|
||||
$output += New-MDList -Lines (Get-ToolcacheRubyVersions) -Style Unordered
|
||||
|
||||
return $output
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
function Get-BashVersion {
|
||||
$version = bash -c 'echo ${BASH_VERSION}'
|
||||
return "Bash $version"
|
||||
return $version
|
||||
}
|
||||
|
||||
function Get-DashVersion {
|
||||
$version = dpkg-query -W -f '${Version}' dash
|
||||
return "Dash $version"
|
||||
return $version
|
||||
}
|
||||
|
||||
function Get-CPPVersions {
|
||||
@@ -13,7 +13,7 @@ function Get-CPPVersions {
|
||||
$cppVersions = $result.Output | Where-Object { $_ -match "g\+\+-\d+"} | ForEach-Object {
|
||||
& $_.Split("/")[0] --version | Select-Object -First 1 | Take-OutputPart -Part 3
|
||||
} | Sort-Object {[Version]$_}
|
||||
return "GNU C++ " + ($cppVersions -Join ", ")
|
||||
return $cppVersions
|
||||
}
|
||||
|
||||
function Get-FortranVersions {
|
||||
@@ -22,7 +22,7 @@ function Get-FortranVersions {
|
||||
$_ -match "now (?<version>\d+\.\d+\.\d+)-" | Out-Null
|
||||
$Matches.version
|
||||
} | Sort-Object {[Version]$_}
|
||||
return "GNU Fortran " + ($fortranVersions -Join ", ")
|
||||
return $fortranVersions
|
||||
}
|
||||
|
||||
function Get-ClangToolVersions {
|
||||
@@ -42,199 +42,179 @@ function Get-ClangToolVersions {
|
||||
}
|
||||
} | Sort-Object {[Version]$_}
|
||||
|
||||
return $toolVersions -Join ", "
|
||||
return $toolVersions
|
||||
}
|
||||
|
||||
function Get-ClangVersions {
|
||||
$clangVersions = Get-ClangToolVersions -ToolName "clang"
|
||||
return "Clang $clangVersions"
|
||||
}
|
||||
|
||||
function Get-ClangFormatVersions {
|
||||
$clangFormatVersions = Get-ClangToolVersions -ToolName "clang-format"
|
||||
return "Clang-format $clangFormatVersions"
|
||||
}
|
||||
|
||||
function Get-ClangTidyVersions {
|
||||
$clangFormatVersions = Get-ClangToolVersions -ToolName "clang-tidy" -VersionLineMatcher "LLVM version" -VersionPattern "\d+\.\d+\.\d+)"
|
||||
return "Clang-tidy $clangFormatVersions"
|
||||
return Get-ClangToolVersions -ToolName "clang-tidy" -VersionLineMatcher "LLVM version" -VersionPattern "\d+\.\d+\.\d+)"
|
||||
}
|
||||
|
||||
|
||||
function Get-ErlangVersion {
|
||||
$erlangVersion = (erl -eval '{ok, Version} = file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), ''OTP_VERSION''])), io:fwrite(Version), halt().' -noshell)
|
||||
$shellVersion = (erl -eval 'erlang:display(erlang:system_info(version)), halt().' -noshell).Trim('"')
|
||||
return "Erlang $erlangVersion (Eshell $shellVersion)"
|
||||
return "$erlangVersion (Eshell $shellVersion)"
|
||||
}
|
||||
|
||||
function Get-ErlangRebar3Version {
|
||||
$result = Get-CommandResult "rebar3 --version"
|
||||
$result.Output -match "rebar (?<version>(\d+.){2}\d+)" | Out-Null
|
||||
$rebarVersion = $Matches.version
|
||||
return "Erlang rebar3 $rebarVersion"
|
||||
return $Matches.version
|
||||
}
|
||||
|
||||
function Get-MonoVersion {
|
||||
$monoVersion = mono --version | Out-String | Take-OutputPart -Part 4
|
||||
return "Mono $monoVersion"
|
||||
return $monoVersion
|
||||
}
|
||||
|
||||
function Get-MsbuildVersion {
|
||||
$msbuildVersion = msbuild -version | Select-Object -Last 1
|
||||
$monoVersion = Get-MonoVersion
|
||||
return "MSBuild $msbuildVersion ($monoVersion)"
|
||||
return "$msbuildVersion (Mono $monoVersion)"
|
||||
}
|
||||
|
||||
function Get-NuGetVersion {
|
||||
$nugetVersion = nuget help | Select-Object -First 1 | Take-OutputPart -Part 2
|
||||
return "NuGet $nugetVersion"
|
||||
return $nugetVersion
|
||||
}
|
||||
|
||||
function Get-NodeVersion {
|
||||
$nodeVersion = $(node --version).Substring(1)
|
||||
return "Node $nodeVersion"
|
||||
return $nodeVersion
|
||||
}
|
||||
|
||||
function Get-OpensslVersion {
|
||||
return "OpenSSL $(dpkg-query -W -f '${Version}' openssl)"
|
||||
return $(dpkg-query -W -f '${Version}' openssl)
|
||||
}
|
||||
|
||||
function Get-PerlVersion {
|
||||
$version = $(perl -e 'print substr($^V,1)')
|
||||
return "Perl $version"
|
||||
return $version
|
||||
}
|
||||
|
||||
function Get-PythonVersion {
|
||||
$result = Get-CommandResult "python --version"
|
||||
$version = $result.Output | Take-OutputPart -Part 1
|
||||
return "Python $version"
|
||||
return $version
|
||||
}
|
||||
|
||||
function Get-Python3Version {
|
||||
$result = Get-CommandResult "python3 --version"
|
||||
$version = $result.Output | Take-OutputPart -Part 1
|
||||
return "Python3 $version"
|
||||
return $version
|
||||
}
|
||||
|
||||
function Get-PowershellVersion {
|
||||
return $(pwsh --version)
|
||||
return $(pwsh --version) | Take-OutputPart -Part 1
|
||||
}
|
||||
|
||||
function Get-RubyVersion {
|
||||
$rubyVersion = ruby --version | Out-String | Take-OutputPart -Part 1
|
||||
return "Ruby $rubyVersion"
|
||||
return $rubyVersion
|
||||
}
|
||||
|
||||
function Get-SwiftVersion {
|
||||
$swiftVersion = swift --version | Out-String | Take-OutputPart -Part 2
|
||||
return "Swift $swiftVersion"
|
||||
return $swiftVersion
|
||||
}
|
||||
|
||||
function Get-KotlinVersion {
|
||||
$kotlinVersion = kotlin -version | Out-String | Take-OutputPart -Part 2
|
||||
return "Kotlin $kotlinVersion"
|
||||
return $kotlinVersion
|
||||
}
|
||||
|
||||
function Get-JuliaVersion {
|
||||
$juliaVersion = julia --version | Take-OutputPart -Part 2
|
||||
return "Julia $juliaVersion"
|
||||
return $juliaVersion
|
||||
}
|
||||
|
||||
function Get-LernaVersion {
|
||||
$version = lerna -v
|
||||
return "Lerna $version"
|
||||
return $version
|
||||
}
|
||||
|
||||
function Get-HomebrewVersion {
|
||||
$result = Get-CommandResult "/home/linuxbrew/.linuxbrew/bin/brew -v"
|
||||
$result.Output -match "Homebrew (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||
$version = $Matches.version
|
||||
return "Homebrew $version"
|
||||
return $Matches.version
|
||||
}
|
||||
|
||||
function Get-CpanVersion {
|
||||
$result = Get-CommandResult "cpan --version" -ExpectExitCode @(25, 255)
|
||||
$result.Output -match "version (?<version>\d+\.\d+) " | Out-Null
|
||||
$cpanVersion = $Matches.version
|
||||
return "cpan $cpanVersion"
|
||||
return $Matches.version
|
||||
}
|
||||
|
||||
function Get-GemVersion {
|
||||
$result = Get-CommandResult "gem --version"
|
||||
$result.Output -match "(?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||
$gemVersion = $Matches.version
|
||||
return "RubyGems $gemVersion"
|
||||
return $Matches.version
|
||||
}
|
||||
|
||||
function Get-MinicondaVersion {
|
||||
$condaVersion = conda --version
|
||||
return "Mini$condaVersion"
|
||||
$condaVersion = conda --version | Take-OutputPart -Part 1
|
||||
return $condaVersion
|
||||
}
|
||||
|
||||
function Get-HelmVersion {
|
||||
$(helm version) -match 'Version:"v(?<version>\d+\.\d+\.\d+)"' | Out-Null
|
||||
$helmVersion = $Matches.version
|
||||
return "Helm $helmVersion"
|
||||
return $Matches.version
|
||||
}
|
||||
|
||||
function Get-NpmVersion {
|
||||
$npmVersion = npm --version
|
||||
return "Npm $npmVersion"
|
||||
return $npmVersion
|
||||
}
|
||||
|
||||
function Get-YarnVersion {
|
||||
$yarnVersion = yarn --version
|
||||
return "Yarn $yarnVersion"
|
||||
return $yarnVersion
|
||||
}
|
||||
|
||||
function Get-ParcelVersion {
|
||||
$parcelVersion = parcel --version
|
||||
return "Parcel $parcelVersion"
|
||||
return $parcelVersion
|
||||
}
|
||||
|
||||
function Get-PipVersion {
|
||||
$result = Get-CommandResult "pip --version"
|
||||
$result.Output -match "pip (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||
$pipVersion = $Matches.version
|
||||
return "Pip $pipVersion"
|
||||
return $Matches.version
|
||||
}
|
||||
|
||||
function Get-Pip3Version {
|
||||
$result = Get-CommandResult "pip3 --version"
|
||||
$result.Output -match "pip (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||
$pipVersion = $Matches.version
|
||||
return "Pip3 $pipVersion"
|
||||
return $Matches.version
|
||||
}
|
||||
|
||||
function Get-VcpkgVersion {
|
||||
$commitId = git -C "/usr/local/share/vcpkg" rev-parse --short HEAD
|
||||
return "Vcpkg (build from commit $commitId)"
|
||||
return "(build from commit $commitId)"
|
||||
}
|
||||
|
||||
function Get-AntVersion {
|
||||
$result = ant -version | Out-String
|
||||
$result -match "version (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||
$antVersion = $Matches.version
|
||||
return "Ant $antVersion"
|
||||
return $Matches.version
|
||||
}
|
||||
|
||||
function Get-GradleVersion {
|
||||
$gradleVersion = (gradle -v) -match "^Gradle \d" | Take-OutputPart -Part 1
|
||||
return "Gradle $gradleVersion"
|
||||
return $gradleVersion
|
||||
}
|
||||
|
||||
function Get-MavenVersion {
|
||||
$result = mvn -version | Out-String
|
||||
$result -match "Apache Maven (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||
$mavenVersion = $Matches.version
|
||||
return "Maven $mavenVersion"
|
||||
return $Matches.version
|
||||
}
|
||||
|
||||
function Get-SbtVersion {
|
||||
$result = Get-CommandResult "sbt -version"
|
||||
$result.Output -match "sbt script version: (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||
$sbtVersion = $Matches.version
|
||||
return "Sbt $sbtVersion"
|
||||
return $Matches.version
|
||||
}
|
||||
|
||||
function Get-PHPVersions {
|
||||
@@ -255,43 +235,24 @@ function Get-PHPUnitVersion {
|
||||
return $Matches.version
|
||||
}
|
||||
|
||||
function Build-PHPSection {
|
||||
$output = ""
|
||||
$output += New-MDHeader "PHP Tools" -Level 3
|
||||
$output += New-MDList -Style Unordered -Lines @(
|
||||
"PHP: $((Get-PHPVersions) -join ', ')",
|
||||
"Composer $(Get-ComposerVersion)",
|
||||
"PHPUnit $(Get-PHPUnitVersion)"
|
||||
)
|
||||
$output += New-MDCode -Lines @(
|
||||
"Both Xdebug and PCOV extensions are installed, but only Xdebug is enabled."
|
||||
)
|
||||
|
||||
return $output
|
||||
}
|
||||
|
||||
function Get-GHCVersion {
|
||||
$(ghc --version) -match "version (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||
$ghcVersion = $Matches.version
|
||||
return "GHC $ghcVersion"
|
||||
return $Matches.version
|
||||
}
|
||||
|
||||
function Get-GHCupVersion {
|
||||
$(ghcup --version) -match "version v(?<version>\d+(\.\d+){2,})" | Out-Null
|
||||
$ghcVersion = $Matches.version
|
||||
return "GHCup $ghcVersion"
|
||||
return $Matches.version
|
||||
}
|
||||
|
||||
function Get-CabalVersion {
|
||||
$(cabal --version | Out-String) -match "cabal-install version (?<version>\d+\.\d+\.\d+\.\d+)" | Out-Null
|
||||
$cabalVersion = $Matches.version
|
||||
return "Cabal $cabalVersion"
|
||||
return $Matches.version
|
||||
}
|
||||
|
||||
function Get-StackVersion {
|
||||
$(stack --version | Out-String) -match "Version (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||
$stackVersion = $Matches.version
|
||||
return "Stack $stackVersion"
|
||||
return $Matches.version
|
||||
}
|
||||
|
||||
function Get-AzModuleVersions {
|
||||
@@ -308,41 +269,36 @@ function Get-PowerShellModules {
|
||||
|
||||
[Array] $azureInstalledModules = Get-ChildItem -Path "/usr/share/az_*" -Directory | ForEach-Object { $_.Name.Split("_")[1] }
|
||||
if ($azureInstalledModules.Count -gt 0) {
|
||||
$result += "Az: $($azureInstalledModules -join ', ')"
|
||||
$result += [ToolVersionsListNode]::new("Az", $azureInstalledModules, "^\d+\.\d+", "Inline")
|
||||
}
|
||||
|
||||
[Array] $azureCachedModules = Get-ChildItem /usr/share/az_*.zip -File | ForEach-Object { $_.Name.Split("_")[1] }
|
||||
if ($azureCachedModules.Count -gt 0) {
|
||||
$result += "Az (Cached): $($azureCachedModules -join ', ')"
|
||||
$result += [ToolVersionsListNode]::new("Az (Cached)", $azureCachedModules, "^\d+\.\d+", "Inline")
|
||||
}
|
||||
|
||||
$result += (Get-ToolsetContent).powershellModules.name | ForEach-Object {
|
||||
(Get-ToolsetContent).powershellModules.name | ForEach-Object {
|
||||
$moduleName = $_
|
||||
$moduleVersions = Get-Module -Name $moduleName -ListAvailable | Select-Object -ExpandProperty Version | Sort-Object -Unique
|
||||
return "$($moduleName): $($moduleVersions -join ', ')"
|
||||
$result += [ToolVersionsListNode]::new($moduleName, $moduleVersions, "^\d+", "Inline")
|
||||
}
|
||||
|
||||
return $result
|
||||
}
|
||||
|
||||
function Get-DotNetCoreSdkVersions {
|
||||
$unsortedDotNetCoreSdkVersion = dotnet --list-sdks list | ForEach-Object { $_ | Take-OutputPart -Part 0 }
|
||||
$dotNetCoreSdkVersion = $unsortedDotNetCoreSdkVersion -join ", "
|
||||
$dotNetCoreSdkVersion = dotnet --list-sdks list | ForEach-Object { $_ | Take-OutputPart -Part 0 }
|
||||
return $dotNetCoreSdkVersion
|
||||
}
|
||||
|
||||
function Get-DotnetTools {
|
||||
$env:PATH = "/etc/skel/.dotnet/tools:$($env:PATH)"
|
||||
|
||||
$dotnetTools = (Get-ToolsetContent).dotnet.tools
|
||||
|
||||
$toolsList = @()
|
||||
|
||||
ForEach ($dotnetTool in $dotnetTools) {
|
||||
$toolsList += $dotnetTool.name + " " + (Invoke-Expression $dotnetTool.getversion)
|
||||
return $dotnetTools | ForEach-Object {
|
||||
$version = Invoke-Expression $_.getversion
|
||||
return [ToolVersionNode]::new($_.name, $version)
|
||||
}
|
||||
|
||||
return $toolsList
|
||||
}
|
||||
|
||||
function Get-CachedDockerImages {
|
||||
@@ -385,8 +341,7 @@ function Get-AptPackages {
|
||||
function Get-PipxVersion {
|
||||
$result = (Get-CommandResult "pipx --version").Output
|
||||
$result -match "(?<version>\d+\.\d+\.\d+\.?\d*)" | Out-Null
|
||||
$pipxVersion = $Matches.Version
|
||||
return "Pipx $pipxVersion"
|
||||
return $Matches.Version
|
||||
}
|
||||
|
||||
function Get-GraalVMVersion {
|
||||
@@ -406,18 +361,13 @@ function Build-GraalVMTable {
|
||||
|
||||
function Build-PackageManagementEnvironmentTable {
|
||||
return @(
|
||||
@{
|
||||
[PSCustomObject] @{
|
||||
"Name" = "CONDA"
|
||||
"Value" = $env:CONDA
|
||||
},
|
||||
@{
|
||||
[PSCustomObject] @{
|
||||
"Name" = "VCPKG_INSTALLATION_ROOT"
|
||||
"Value" = $env:VCPKG_INSTALLATION_ROOT
|
||||
}
|
||||
) | ForEach-Object {
|
||||
[PSCustomObject] @{
|
||||
"Name" = $_.Name
|
||||
"Value" = $_.Value
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
function Get-PostgreSqlVersion {
|
||||
$postgreSQLVersion = psql --version | Take-OutputPart -Part 2
|
||||
return "PostgreSQL $postgreSQLVersion"
|
||||
return $postgreSQLVersion
|
||||
}
|
||||
|
||||
function Get-MongoDbVersion {
|
||||
$mongoDBVersion = mongod --version | Select-Object -First 1 | Take-OutputPart -Part 2 -Delimiter "v"
|
||||
return "MongoDB $mongoDBVersion"
|
||||
return $mongoDBVersion
|
||||
}
|
||||
|
||||
function Get-SqliteVersion {
|
||||
$sqliteVersion = sqlite3 --version | Take-OutputPart -Part 0
|
||||
return "sqlite3 $sqliteVersion"
|
||||
return $sqliteVersion
|
||||
}
|
||||
|
||||
function Get-MySQLVersion {
|
||||
@@ -18,60 +18,47 @@ function Get-MySQLVersion {
|
||||
if (Test-IsUbuntu18) {
|
||||
$mySQLVersion = $mySQLVersion | Take-OutputPart -Part 0 -Delimiter "-"
|
||||
}
|
||||
return "MySQL $mySQLVersion"
|
||||
return $mySQLVersion
|
||||
}
|
||||
|
||||
function Get-SQLCmdVersion {
|
||||
$sqlcmdVersion = sqlcmd -? | Select-String -Pattern "Version" | Take-OutputPart -Part 1
|
||||
return "sqlcmd $sqlcmdVersion"
|
||||
return $sqlcmdVersion
|
||||
}
|
||||
|
||||
function Get-SqlPackageVersion {
|
||||
$sqlPackageVersion = sqlpackage /version
|
||||
return "SqlPackage $sqlPackageVersion"
|
||||
return $sqlPackageVersion
|
||||
}
|
||||
|
||||
function Build-PostgreSqlSection {
|
||||
$output = ""
|
||||
|
||||
$output += New-MDHeader "PostgreSQL" -Level 4
|
||||
$output += New-MDList -Style Unordered -Lines @(
|
||||
(Get-PostgreSqlVersion)
|
||||
)
|
||||
$output += New-MDCode -Lines @(
|
||||
$node = [HeaderNode]::new("PostgreSQL")
|
||||
$node.AddToolVersion("PostgreSQL", $(Get-PostgreSqlVersion))
|
||||
$node.AddNote(@(
|
||||
"User: postgres",
|
||||
"PostgreSQL service is disabled by default.",
|
||||
"Use the following command as a part of your job to start the service: 'sudo systemctl start postgresql.service'"
|
||||
)
|
||||
) -join "`n")
|
||||
|
||||
return $output
|
||||
return $node
|
||||
}
|
||||
|
||||
function Build-MySQLSection {
|
||||
$output = ""
|
||||
|
||||
$output += New-MDHeader "MySQL" -Level 4
|
||||
$output += New-MDList -Style Unordered -Lines @(
|
||||
(Get-MySQLVersion )
|
||||
)
|
||||
$output += New-MDCode -Lines @(
|
||||
$node = [HeaderNode]::new("MySQL")
|
||||
$node.AddToolVersion("MySQL", $(Get-MySQLVersion))
|
||||
$node.AddNote(@(
|
||||
"User: root",
|
||||
"Password: root",
|
||||
"MySQL service is disabled by default.",
|
||||
"Use the following command as a part of your job to start the service: 'sudo systemctl start mysql.service'"
|
||||
)
|
||||
) -join "`n")
|
||||
|
||||
return $output
|
||||
return $node
|
||||
}
|
||||
|
||||
function Build-MSSQLToolsSection {
|
||||
$output = ""
|
||||
|
||||
$output += New-MDHeader "MS SQL Server Client Tools" -Level 4
|
||||
$output += New-MDList -Style Unordered -Lines @(
|
||||
(Get-SQLCmdVersion),
|
||||
(Get-SqlPackageVersion)
|
||||
)
|
||||
|
||||
return $output
|
||||
$node = [HeaderNode]::new("MS SQL")
|
||||
$node.AddToolVersion("sqlcmd", $(Get-SQLCmdVersion))
|
||||
$node.AddToolVersion("SqlPackage", $(Get-SqlPackageVersion))
|
||||
return $node
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
using module ./software-report-base/SoftwareReport.psm1
|
||||
using module ./software-report-base/SoftwareReport.Nodes.psm1
|
||||
|
||||
param (
|
||||
[Parameter(Mandatory)][string]
|
||||
$OutputDirectory
|
||||
@@ -7,7 +10,6 @@ $global:ErrorActionPreference = "Stop"
|
||||
$global:ErrorView = "NormalView"
|
||||
Set-StrictMode -Version Latest
|
||||
|
||||
Import-Module MarkdownPS
|
||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Android.psm1") -DisableNameChecking
|
||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Browsers.psm1") -DisableNameChecking
|
||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.CachedTools.psm1") -DisableNameChecking
|
||||
@@ -23,285 +25,221 @@ Import-Module (Join-Path $PSScriptRoot "SoftwareReport.WebServers.psm1") -Disabl
|
||||
# Restore file owner in user profile
|
||||
Restore-UserOwner
|
||||
|
||||
$markdown = ""
|
||||
$markdown += New-MDHeader "Ubuntu $(Get-OSVersionShort)" -Level 1
|
||||
# Software report
|
||||
$softwareReport = [SoftwareReport]::new("Ubuntu $(Get-OSVersionShort)")
|
||||
$softwareReport.Root.AddToolVersion("OS Version:", $(Get-OSVersionFull))
|
||||
$softwareReport.Root.AddToolVersion("Kernel Version:", $(Get-KernelVersion))
|
||||
$softwareReport.Root.AddToolVersion("Image Version:", $env:IMAGE_VERSION)
|
||||
|
||||
$markdown += New-MDList -Style Unordered -Lines @(
|
||||
"OS Version: $(Get-OSVersionFull)"
|
||||
"Kernel Version: $(Get-KernelVersion)"
|
||||
"Image Version: $env:IMAGE_VERSION"
|
||||
)
|
||||
|
||||
$markdown += New-MDHeader "Installed Software" -Level 2
|
||||
$markdown += New-MDHeader "Language and Runtime" -Level 3
|
||||
|
||||
$runtimesList = @(
|
||||
(Get-BashVersion),
|
||||
(Get-DashVersion),
|
||||
(Get-CPPVersions),
|
||||
(Get-FortranVersions),
|
||||
(Get-MsbuildVersion),
|
||||
(Get-MonoVersion),
|
||||
(Get-NodeVersion),
|
||||
(Get-PerlVersion),
|
||||
(Get-PythonVersion),
|
||||
(Get-Python3Version),
|
||||
(Get-RubyVersion),
|
||||
(Get-JuliaVersion),
|
||||
(Get-ClangVersions),
|
||||
(Get-ClangFormatVersions),
|
||||
(Get-ClangTidyVersions),
|
||||
(Get-KotlinVersion),
|
||||
(Get-SwiftVersion)
|
||||
)
|
||||
$installedSoftware = $softwareReport.Root.AddHeader("Installed Software")
|
||||
|
||||
# Language and Runtime
|
||||
$languageAndRuntime = $installedSoftware.AddHeader("Language and Runtime")
|
||||
$languageAndRuntime.AddToolVersion("Bash", $(Get-BashVersion))
|
||||
$languageAndRuntime.AddToolVersionsListInline("Clang", $(Get-ClangToolVersions -ToolName "clang"), "^\d+")
|
||||
$languageAndRuntime.AddToolVersionsListInline("Clang-format", $(Get-ClangToolVersions -ToolName "clang-format"), "^\d+")
|
||||
$languageAndRuntime.AddToolVersionsListInline("Clang-tidy", $(Get-ClangTidyVersions), "^\d+")
|
||||
$languageAndRuntime.AddToolVersion("Dash", $(Get-DashVersion))
|
||||
if ((Test-IsUbuntu18) -or (Test-IsUbuntu20)) {
|
||||
$runtimesList += @(
|
||||
(Get-ErlangVersion),
|
||||
(Get-ErlangRebar3Version)
|
||||
)
|
||||
$languageAndRuntime.AddToolVersion("Erlang", $(Get-ErlangVersion))
|
||||
$languageAndRuntime.AddToolVersion("Erlang rebar3", $(Get-ErlangRebar3Version))
|
||||
}
|
||||
$languageAndRuntime.AddToolVersionsListInline("GNU C++", $(Get-CPPVersions), "^\d+")
|
||||
$languageAndRuntime.AddToolVersionsListInline("GNU Fortran", $(Get-FortranVersions), "^\d+")
|
||||
$languageAndRuntime.AddToolVersion("Julia", $(Get-JuliaVersion))
|
||||
$languageAndRuntime.AddToolVersion("Kotlin", $(Get-KotlinVersion))
|
||||
$languageAndRuntime.AddToolVersion("Mono", $(Get-MonoVersion))
|
||||
$languageAndRuntime.AddToolVersion("MSBuild", $(Get-MsbuildVersion))
|
||||
$languageAndRuntime.AddToolVersion("Node.js", $(Get-NodeVersion))
|
||||
$languageAndRuntime.AddToolVersion("Perl", $(Get-PerlVersion))
|
||||
$languageAndRuntime.AddToolVersion("Python", $(Get-PythonVersion))
|
||||
$languageAndRuntime.AddToolVersion("Python3", $(Get-Python3Version))
|
||||
$languageAndRuntime.AddToolVersion("Ruby", $(Get-RubyVersion))
|
||||
$languageAndRuntime.AddToolVersion("Swift", $(Get-SwiftVersion))
|
||||
|
||||
$markdown += New-MDList -Style Unordered -Lines ($runtimesList | Sort-Object)
|
||||
|
||||
$markdown += New-MDHeader "Package Management" -Level 3
|
||||
|
||||
$packageManagementList = @(
|
||||
(Get-HomebrewVersion),
|
||||
(Get-CpanVersion),
|
||||
(Get-GemVersion),
|
||||
(Get-MinicondaVersion),
|
||||
(Get-NuGetVersion),
|
||||
(Get-HelmVersion),
|
||||
(Get-NpmVersion),
|
||||
(Get-YarnVersion),
|
||||
(Get-PipxVersion),
|
||||
(Get-PipVersion),
|
||||
(Get-Pip3Version),
|
||||
(Get-VcpkgVersion)
|
||||
)
|
||||
|
||||
$markdown += New-MDList -Style Unordered -Lines ($packageManagementList | Sort-Object)
|
||||
|
||||
$markdown += New-MDHeader "Environment variables" -Level 4
|
||||
$markdown += Build-PackageManagementEnvironmentTable | New-MDTable
|
||||
$markdown += New-MDNewLine
|
||||
|
||||
$markdown += New-MDHeader "Homebrew note" -Level 4
|
||||
$reportHomebrew = @'
|
||||
```
|
||||
# Package Management
|
||||
$packageManagement = $installedSoftware.AddHeader("Package Management")
|
||||
$packageManagement.AddToolVersion("cpan", $(Get-CpanVersion))
|
||||
$packageManagement.AddToolVersion("Helm", $(Get-HelmVersion))
|
||||
$packageManagement.AddToolVersion("Homebrew", $(Get-HomebrewVersion))
|
||||
$packageManagement.AddToolVersion("Miniconda", $(Get-MinicondaVersion))
|
||||
$packageManagement.AddToolVersion("Npm", $(Get-NpmVersion))
|
||||
$packageManagement.AddToolVersion("NuGet", $(Get-NuGetVersion))
|
||||
$packageManagement.AddToolVersion("Pip", $(Get-PipVersion))
|
||||
$packageManagement.AddToolVersion("Pip3", $(Get-Pip3Version))
|
||||
$packageManagement.AddToolVersion("Pipx", $(Get-PipxVersion))
|
||||
$packageManagement.AddToolVersion("RubyGems", $(Get-GemVersion))
|
||||
$packageManagement.AddToolVersion("Vcpkg", $(Get-VcpkgVersion))
|
||||
$packageManagement.AddToolVersion("Yarn", $(Get-YarnVersion))
|
||||
$packageManagement.AddHeader("Environment variables").AddTable($(Build-PackageManagementEnvironmentTable))
|
||||
$packageManagement.AddHeader("Homebrew note").AddNote(@'
|
||||
Location: /home/linuxbrew
|
||||
Note: Homebrew is pre-installed on image but not added to PATH.
|
||||
run the eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" command
|
||||
to accomplish this.
|
||||
```
|
||||
'@
|
||||
$markdown += New-MDParagraph -Lines $reportHomebrew
|
||||
'@)
|
||||
|
||||
$markdown += New-MDHeader "Project Management" -Level 3
|
||||
$projectManagementList = @()
|
||||
# Project Management
|
||||
$projectManagement = $installedSoftware.AddHeader("Project Management")
|
||||
if ((Test-IsUbuntu18) -or (Test-IsUbuntu20)) {
|
||||
$projectManagementList += @(
|
||||
(Get-AntVersion),
|
||||
(Get-GradleVersion),
|
||||
(Get-MavenVersion),
|
||||
(Get-SbtVersion)
|
||||
)
|
||||
$projectManagement.AddToolVersion("Ant", $(Get-AntVersion))
|
||||
$projectManagement.AddToolVersion("Gradle", $(Get-GradleVersion))
|
||||
}
|
||||
|
||||
if ((Test-IsUbuntu20) -or (Test-IsUbuntu22)) {
|
||||
$projectManagementList += @(
|
||||
(Get-LernaVersion)
|
||||
)
|
||||
$projectManagement.AddToolVersion("Lerna", $(Get-LernaVersion))
|
||||
}
|
||||
$markdown += New-MDList -Style Unordered -Lines ($projectManagementList | Sort-Object)
|
||||
|
||||
$markdown += New-MDHeader "Tools" -Level 3
|
||||
$toolsList = @(
|
||||
(Get-AnsibleVersion),
|
||||
(Get-AptFastVersion),
|
||||
(Get-AzCopyVersion),
|
||||
(Get-BazelVersion),
|
||||
(Get-BazeliskVersion),
|
||||
(Get-BicepVersion),
|
||||
(Get-CodeQLBundleVersion),
|
||||
(Get-CMakeVersion),
|
||||
(Get-DockerMobyClientVersion),
|
||||
(Get-DockerMobyServerVersion),
|
||||
(Get-DockerComposeV1Version),
|
||||
(Get-DockerComposeV2Version),
|
||||
(Get-DockerBuildxVersion),
|
||||
(Get-DockerAmazonECRCredHelperVersion),
|
||||
(Get-BuildahVersion),
|
||||
(Get-PodManVersion),
|
||||
(Get-SkopeoVersion),
|
||||
(Get-GitVersion),
|
||||
(Get-GitLFSVersion),
|
||||
(Get-GitFTPVersion),
|
||||
(Get-HavegedVersion),
|
||||
(Get-HerokuVersion),
|
||||
(Get-LeiningenVersion),
|
||||
(Get-SVNVersion),
|
||||
(Get-JqVersion),
|
||||
(Get-YqVersion),
|
||||
(Get-KindVersion),
|
||||
(Get-KubectlVersion),
|
||||
(Get-KustomizeVersion),
|
||||
(Get-MediainfoVersion),
|
||||
(Get-HGVersion),
|
||||
(Get-MinikubeVersion),
|
||||
(Get-NewmanVersion),
|
||||
(Get-NVersion),
|
||||
(Get-NvmVersion),
|
||||
(Get-OpensslVersion),
|
||||
(Get-PackerVersion),
|
||||
(Get-ParcelVersion),
|
||||
(Get-PulumiVersion),
|
||||
(Get-RVersion),
|
||||
(Get-SphinxVersion),
|
||||
(Get-TerraformVersion),
|
||||
(Get-YamllintVersion),
|
||||
(Get-ZstdVersion)
|
||||
)
|
||||
|
||||
if ((Test-IsUbuntu18) -or (Test-IsUbuntu20)) {
|
||||
$toolsList += @(
|
||||
(Get-PhantomJSVersion),
|
||||
(Get-HHVMVersion)
|
||||
)
|
||||
$projectManagement.AddToolVersion("Maven", $(Get-MavenVersion))
|
||||
$projectManagement.AddToolVersion("Sbt", $(Get-SbtVersion))
|
||||
}
|
||||
|
||||
# Tools
|
||||
$tools = $installedSoftware.AddHeader("Tools")
|
||||
$tools.AddToolVersion("Ansible", $(Get-AnsibleVersion))
|
||||
$tools.AddToolVersion("apt-fast", $(Get-AptFastVersion))
|
||||
$tools.AddToolVersion("AzCopy", $(Get-AzCopyVersion))
|
||||
$tools.AddToolVersion("Bazel", $(Get-BazelVersion))
|
||||
$tools.AddToolVersion("Bazelisk", $(Get-BazeliskVersion))
|
||||
$tools.AddToolVersion("Bicep", $(Get-BicepVersion))
|
||||
$tools.AddToolVersion("Buildah", $(Get-BuildahVersion))
|
||||
$tools.AddToolVersion("CMake", $(Get-CMakeVersion))
|
||||
$tools.AddToolVersion("CodeQL Action Bundle", $(Get-CodeQLBundleVersion))
|
||||
$tools.AddToolVersion("Docker Amazon ECR Credential Helper", $(Get-DockerAmazonECRCredHelperVersion))
|
||||
$tools.AddToolVersion("Docker Compose v1", $(Get-DockerComposeV1Version))
|
||||
$tools.AddToolVersion("Docker Compose v2", $(Get-DockerComposeV2Version))
|
||||
$tools.AddToolVersion("Docker-Buildx", $(Get-DockerBuildxVersion))
|
||||
$tools.AddToolVersion("Docker-Moby Client", $(Get-DockerMobyClientVersion))
|
||||
$tools.AddToolVersion("Docker-Moby Server", $(Get-DockerMobyServerVersion))
|
||||
if ((Test-IsUbuntu20) -or (Test-IsUbuntu22)) {
|
||||
$toolsList += (Get-FastlaneVersion)
|
||||
$tools.AddToolVersion("Fastlane", $(Get-FastlaneVersion))
|
||||
}
|
||||
|
||||
$markdown += New-MDList -Style Unordered -Lines ($toolsList | Sort-Object)
|
||||
|
||||
$markdown += New-MDHeader "CLI Tools" -Level 3
|
||||
$markdown += New-MDList -Style Unordered -Lines (@(
|
||||
(Get-AlibabaCloudCliVersion),
|
||||
(Get-AWSCliVersion),
|
||||
(Get-AWSCliSessionManagerPluginVersion),
|
||||
(Get-AWSSAMVersion),
|
||||
(Get-AzureCliVersion),
|
||||
(Get-AzureDevopsVersion),
|
||||
(Get-GitHubCliVersion),
|
||||
(Get-GoogleCloudSDKVersion),
|
||||
(Get-HubCliVersion),
|
||||
(Get-NetlifyCliVersion),
|
||||
(Get-OCCliVersion),
|
||||
(Get-ORASCliVersion),
|
||||
(Get-VerselCliversion)
|
||||
)
|
||||
)
|
||||
|
||||
$markdown += New-MDHeader "Java" -Level 3
|
||||
$markdown += Get-JavaVersions | New-MDTable
|
||||
$markdown += New-MDNewLine
|
||||
|
||||
if ((Test-IsUbuntu20) -or (Test-IsUbuntu22)) {
|
||||
$markdown += New-MDHeader "GraalVM" -Level 3
|
||||
$markdown += Build-GraalVMTable | New-MDTable
|
||||
$markdown += New-MDNewLine
|
||||
}
|
||||
|
||||
$markdown += Build-PHPSection
|
||||
|
||||
$markdown += New-MDHeader "Haskell" -Level 3
|
||||
$markdown += New-MDList -Style Unordered -Lines (@(
|
||||
(Get-GHCVersion),
|
||||
(Get-GHCupVersion),
|
||||
(Get-CabalVersion),
|
||||
(Get-StackVersion)
|
||||
) | Sort-Object
|
||||
)
|
||||
|
||||
$markdown += New-MDHeader "Rust Tools" -Level 3
|
||||
$markdown += New-MDList -Style Unordered -Lines (@(
|
||||
(Get-RustVersion),
|
||||
(Get-RustupVersion),
|
||||
(Get-RustdocVersion),
|
||||
(Get-CargoVersion)
|
||||
) | Sort-Object
|
||||
)
|
||||
|
||||
$markdown += New-MDHeader "Packages" -Level 4
|
||||
$markdown += New-MDList -Style Unordered -Lines (@(
|
||||
(Get-BindgenVersion),
|
||||
(Get-CargoAuditVersion),
|
||||
(Get-CargoOutdatedVersion),
|
||||
(Get-CargoClippyVersion),
|
||||
(Get-CbindgenVersion),
|
||||
(Get-RustfmtVersion)
|
||||
) | Sort-Object
|
||||
)
|
||||
|
||||
$markdown += New-MDHeader "Browsers and Drivers" -Level 3
|
||||
|
||||
$browsersAndDriversList = @(
|
||||
(Get-ChromeVersion),
|
||||
(Get-ChromeDriverVersion),
|
||||
(Get-ChromiumVersion),
|
||||
(Get-EdgeVersion),
|
||||
(Get-EdgeDriverVersion),
|
||||
(Get-SeleniumVersion),
|
||||
(Get-FirefoxVersion),
|
||||
(Get-GeckodriverVersion)
|
||||
)
|
||||
|
||||
$markdown += New-MDList -Style Unordered -Lines $browsersAndDriversList
|
||||
$markdown += New-MDHeader "Environment variables" -Level 4
|
||||
$markdown += Build-BrowserWebdriversEnvironmentTable | New-MDTable
|
||||
$markdown += New-MDNewLine
|
||||
|
||||
$markdown += New-MDHeader ".NET Core Tools" -Level 3
|
||||
$netCoreTools = @(
|
||||
".NET Core SDK: $(Get-DotNetCoreSdkVersions)"
|
||||
)
|
||||
$netCoreTools += Get-DotnetTools
|
||||
$markdown += New-MDList -Style Unordered -Lines $netCoreTools
|
||||
|
||||
$markdown += New-MDHeader "Databases" -Level 3
|
||||
$databaseLists = @(
|
||||
(Get-SqliteVersion)
|
||||
)
|
||||
|
||||
$tools.AddToolVersion("Git", $(Get-GitVersion))
|
||||
$tools.AddToolVersion("Git LFS", $(Get-GitLFSVersion))
|
||||
$tools.AddToolVersion("Git-ftp", $(Get-GitFTPVersion))
|
||||
$tools.AddToolVersion("Haveged", $(Get-HavegedVersion))
|
||||
$tools.AddToolVersion("Heroku", $(Get-HerokuVersion))
|
||||
if ((Test-IsUbuntu18) -or (Test-IsUbuntu20)) {
|
||||
$databaseLists += @(
|
||||
(Get-MongoDbVersion)
|
||||
)
|
||||
$tools.AddToolVersion("HHVM (HipHop VM)", $(Get-HHVMVersion))
|
||||
}
|
||||
$tools.AddToolVersion("jq", $(Get-JqVersion))
|
||||
$tools.AddToolVersion("Kind", $(Get-KindVersion))
|
||||
$tools.AddToolVersion("Kubectl", $(Get-KubectlVersion))
|
||||
$tools.AddToolVersion("Kustomize", $(Get-KustomizeVersion))
|
||||
$tools.AddToolVersion("Leiningen", $(Get-LeiningenVersion))
|
||||
$tools.AddToolVersion("MediaInfo", $(Get-MediainfoVersion))
|
||||
$tools.AddToolVersion("Mercurial", $(Get-HGVersion))
|
||||
$tools.AddToolVersion("Minikube", $(Get-MinikubeVersion))
|
||||
$tools.AddToolVersion("n", $(Get-NVersion))
|
||||
$tools.AddToolVersion("Newman", $(Get-NewmanVersion))
|
||||
$tools.AddToolVersion("nvm", $(Get-NvmVersion))
|
||||
$tools.AddToolVersion("OpenSSL", $(Get-OpensslVersion))
|
||||
$tools.AddToolVersion("Packer", $(Get-PackerVersion))
|
||||
$tools.AddToolVersion("Parcel", $(Get-ParcelVersion))
|
||||
if ((Test-IsUbuntu18) -or (Test-IsUbuntu20)) {
|
||||
$tools.AddToolVersion("PhantomJS", $(Get-PhantomJSVersion))
|
||||
}
|
||||
$tools.AddToolVersion("Podman", $(Get-PodManVersion))
|
||||
$tools.AddToolVersion("Pulumi", $(Get-PulumiVersion))
|
||||
$tools.AddToolVersion("R", $(Get-RVersion))
|
||||
$tools.AddToolVersion("Skopeo", $(Get-SkopeoVersion))
|
||||
$tools.AddToolVersion("Sphinx Open Source Search Server", $(Get-SphinxVersion))
|
||||
$tools.AddToolVersion("SVN", $(Get-SVNVersion))
|
||||
$tools.AddToolVersion("Terraform", $(Get-TerraformVersion))
|
||||
$tools.AddToolVersion("yamllint", $(Get-YamllintVersion))
|
||||
$tools.AddToolVersion("yq", $(Get-YqVersion))
|
||||
$tools.AddToolVersion("zstd", $(Get-ZstdVersion))
|
||||
|
||||
# CLI Tools
|
||||
$cliTools = $installedSoftware.AddHeader("CLI Tools")
|
||||
$cliTools.AddToolVersion("Alibaba Cloud CLI", $(Get-AlibabaCloudCliVersion))
|
||||
$cliTools.AddToolVersion("AWS CLI", $(Get-AWSCliVersion))
|
||||
$cliTools.AddToolVersion("AWS CLI Session Manager Plugin", $(Get-AWSCliSessionManagerPluginVersion))
|
||||
$cliTools.AddToolVersion("AWS SAM CLI", $(Get-AWSSAMVersion))
|
||||
$cliTools.AddToolVersion("Azure CLI", $(Get-AzureCliVersion))
|
||||
$cliTools.AddToolVersion("Azure CLI (azure-devops)", $(Get-AzureDevopsVersion))
|
||||
$cliTools.AddToolVersion("GitHub CLI", $(Get-GitHubCliVersion))
|
||||
$cliTools.AddToolVersion("Google Cloud SDK", $(Get-GoogleCloudSDKVersion))
|
||||
$cliTools.AddToolVersion("Hub CLI", $(Get-HubCliVersion))
|
||||
$cliTools.AddToolVersion("Netlify CLI", $(Get-NetlifyCliVersion))
|
||||
$cliTools.AddToolVersion("OpenShift CLI", $(Get-OCCliVersion))
|
||||
$cliTools.AddToolVersion("ORAS CLI", $(Get-ORASCliVersion))
|
||||
$cliTools.AddToolVersion("Vercel CLI", $(Get-VerselCliversion))
|
||||
|
||||
|
||||
$installedSoftware.AddHeader("Java").AddTable($(Get-JavaVersionsTable))
|
||||
if ((Test-IsUbuntu20) -or (Test-IsUbuntu22)) {
|
||||
$installedSoftware.AddHeader("GraalVM").AddTable($(Build-GraalVMTable))
|
||||
}
|
||||
|
||||
$markdown += New-MDList -Style Unordered -Lines ( $databaseLists | Sort-Object )
|
||||
$phpTools = $installedSoftware.AddHeader("PHP Tools")
|
||||
$phpTools.AddToolVersionsListInline("PHP", $(Get-PHPVersions), "^\d+\.\d+")
|
||||
$phpTools.AddToolVersion("Composer", $(Get-ComposerVersion))
|
||||
$phpTools.AddToolVersion("PHPUnit", $(Get-PHPUnitVersion))
|
||||
$phpTools.AddNote("Both Xdebug and PCOV extensions are installed, but only Xdebug is enabled.")
|
||||
|
||||
$markdown += Build-PostgreSqlSection
|
||||
$markdown += Build-MySQLSection
|
||||
$markdown += Build-MSSQLToolsSection
|
||||
$haskellTools = $installedSoftware.AddHeader("Haskell Tools")
|
||||
$haskellTools.AddToolVersion("Cabal", $(Get-CabalVersion))
|
||||
$haskellTools.AddToolVersion("GHC", $(Get-GHCVersion))
|
||||
$haskellTools.AddToolVersion("GHCup", $(Get-GHCupVersion))
|
||||
$haskellTools.AddToolVersion("Stack", $(Get-StackVersion))
|
||||
|
||||
$markdown += New-MDHeader "Cached Tools" -Level 3
|
||||
$markdown += Build-CachedToolsSection
|
||||
Initialize-RustEnvironment
|
||||
$rustTools = $installedSoftware.AddHeader("Rust Tools")
|
||||
$rustTools.AddToolVersion("Cargo", $(Get-CargoVersion))
|
||||
$rustTools.AddToolVersion("Rust", $(Get-RustVersion))
|
||||
$rustTools.AddToolVersion("Rustdoc", $(Get-RustdocVersion))
|
||||
$rustTools.AddToolVersion("Rustup", $(Get-RustupVersion))
|
||||
$rustToolsPackages = $rustTools.AddHeader("Packages")
|
||||
$rustToolsPackages.AddToolVersion("Bindgen", $(Get-BindgenVersion))
|
||||
$rustToolsPackages.AddToolVersion("Cargo audit", $(Get-CargoAuditVersion))
|
||||
$rustToolsPackages.AddToolVersion("Cargo clippy", $(Get-CargoClippyVersion))
|
||||
$rustToolsPackages.AddToolVersion("Cargo outdated", $(Get-CargoOutdatedVersion))
|
||||
$rustToolsPackages.AddToolVersion("Cbindgen", $(Get-CbindgenVersion))
|
||||
$rustToolsPackages.AddToolVersion("Rustfmt", $(Get-RustfmtVersion))
|
||||
|
||||
$markdown += New-MDHeader "PowerShell Tools" -Level 3
|
||||
$markdown += New-MDList -Lines (Get-PowershellVersion) -Style Unordered
|
||||
$browsersTools = $installedSoftware.AddHeader("Browsers and Drivers")
|
||||
$browsersTools.AddToolVersion("Google Chrome", $(Get-ChromeVersion))
|
||||
$browsersTools.AddToolVersion("ChromeDriver", $(Get-ChromeDriverVersion))
|
||||
$browsersTools.AddToolVersion("Chromium", $(Get-ChromiumVersion))
|
||||
$browsersTools.AddToolVersion("Microsoft Edge", $(Get-EdgeVersion))
|
||||
$browsersTools.AddToolVersion("Microsoft Edge WebDriver", $(Get-EdgeDriverVersion))
|
||||
$browsersTools.AddToolVersion("Selenium server", $(Get-SeleniumVersion))
|
||||
$browsersTools.AddToolVersion("Mozilla Firefox", $(Get-FirefoxVersion))
|
||||
$browsersTools.AddToolVersion("Geckodriver", $(Get-GeckodriverVersion))
|
||||
$browsersTools.AddHeader("Environment variables").AddTable($(Build-BrowserWebdriversEnvironmentTable))
|
||||
|
||||
$markdown += New-MDHeader "PowerShell Modules" -Level 4
|
||||
$markdown += New-MDList -Lines $(Get-PowerShellModules) -Style Unordered
|
||||
$netCoreTools = $installedSoftware.AddHeader(".NET Core Tools")
|
||||
$netCoreTools.AddToolVersionsListInline(".NET Core SDK", $(Get-DotNetCoreSdkVersions), "^\d+\.\d+\.\d")
|
||||
$netCoreTools.AddNodes($(Get-DotnetTools))
|
||||
|
||||
$markdown += Build-WebServersSection
|
||||
$databasesTools = $installedSoftware.AddHeader("Databases")
|
||||
if ((Test-IsUbuntu18) -or (Test-IsUbuntu20)) {
|
||||
$databasesTools.AddToolVersion("MongoDB", $(Get-MongoDbVersion))
|
||||
}
|
||||
$databasesTools.AddToolVersion("sqlite3", $(Get-SqliteVersion))
|
||||
$databasesTools.AddNode($(Build-PostgreSqlSection))
|
||||
$databasesTools.AddNode($(Build-MySQLSection))
|
||||
$databasesTools.AddNode($(Build-MSSQLToolsSection))
|
||||
|
||||
$markdown += New-MDHeader "Android" -Level 3
|
||||
$markdown += Build-AndroidTable | New-MDTable
|
||||
$markdown += New-MDNewLine
|
||||
$markdown += New-MDHeader "Environment variables" -Level 4
|
||||
$markdown += Build-AndroidEnvironmentTable | New-MDTable
|
||||
$markdown += New-MDNewLine
|
||||
$cachedTools = $installedSoftware.AddHeader("Cached Tools")
|
||||
$cachedTools.AddToolVersionsList("Go", $(Get-ToolcacheGoVersions), "^\d+\.\d+")
|
||||
$cachedTools.AddToolVersionsList("Node.js", $(Get-ToolcacheNodeVersions), "^\d+")
|
||||
$cachedTools.AddToolVersionsList("Python", $(Get-ToolcachePythonVersions), "^\d+\.\d+")
|
||||
$cachedTools.AddToolVersionsList("PyPy", $(Get-ToolcachePyPyVersions), "^\d+\.\d+")
|
||||
$cachedTools.AddToolVersionsList("Ruby", $(Get-ToolcacheRubyVersions), "^\d+\.\d+")
|
||||
|
||||
$markdown += New-MDHeader "Cached Docker images" -Level 3
|
||||
$markdown += Get-CachedDockerImagesTableData | New-MDTable
|
||||
$markdown += New-MDNewLine
|
||||
$powerShellTools = $installedSoftware.AddHeader("PowerShell Tools")
|
||||
$powerShellTools.AddToolVersion("PowerShell", $(Get-PowershellVersion))
|
||||
$powerShellTools.AddHeader("PowerShell Modules").AddNodes($(Get-PowerShellModules))
|
||||
|
||||
$markdown += New-MDHeader "Installed apt packages" -Level 3
|
||||
$markdown += Get-AptPackages | New-MDTable
|
||||
$installedSoftware.AddHeader("Web Servers").AddTable($(Build-WebServersTable))
|
||||
|
||||
Test-BlankElement
|
||||
$markdown | Out-File -FilePath "${OutputDirectory}/Ubuntu-Readme.md"
|
||||
$androidTools = $installedSoftware.AddHeader("Android")
|
||||
$androidTools.AddTable($(Build-AndroidTable))
|
||||
$androidTools.AddHeader("Environment variables").AddTable($(Build-AndroidEnvironmentTable))
|
||||
|
||||
$installedSoftware.AddHeader("Cached Docker images").AddTable($(Get-CachedDockerImagesTableData))
|
||||
$installedSoftware.AddHeader("Installed apt packages").AddTable($(Get-AptPackages))
|
||||
|
||||
$softwareReport.ToJson() | Out-File -FilePath "${OutputDirectory}/software-report.json" -Encoding UTF8NoBOM
|
||||
$softwareReport.ToMarkdown() | Out-File -FilePath "${OutputDirectory}/software-report.md" -Encoding UTF8NoBOM
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
function Get-JavaVersions {
|
||||
function Get-JavaVersionsTable {
|
||||
$javaToolcacheVersions = Get-ChildItem $env:AGENT_TOOLSDIRECTORY/Java*/* -Directory | Sort-Object { [int]$_.Name.Split(".")[0] }
|
||||
|
||||
$existingVersions = $javaToolcacheVersions | ForEach-Object {
|
||||
|
||||
@@ -5,52 +5,51 @@ function Initialize-RustEnvironment {
|
||||
}
|
||||
|
||||
function Get-RustVersion {
|
||||
Initialize-RustEnvironment
|
||||
$rustVersion = $(rustc --version) | Take-OutputPart -Part 1
|
||||
return "Rust $rustVersion"
|
||||
return $rustVersion
|
||||
}
|
||||
|
||||
function Get-BindgenVersion {
|
||||
$bindgenVersion = $(bindgen --version) | Take-OutputPart -Part 1
|
||||
return "Bindgen $bindgenVersion"
|
||||
return $bindgenVersion
|
||||
}
|
||||
|
||||
function Get-CargoVersion {
|
||||
$cargoVersion = $(cargo --version) | Take-OutputPart -Part 1
|
||||
return "Cargo $cargoVersion"
|
||||
return $cargoVersion
|
||||
}
|
||||
|
||||
function Get-CargoAuditVersion {
|
||||
$cargoAuditVersion = $(cargo-audit --version) | Take-OutputPart -Part 1
|
||||
return "Cargo audit $cargoAuditVersion"
|
||||
return $cargoAuditVersion
|
||||
}
|
||||
|
||||
function Get-CargoOutdatedVersion {
|
||||
$cargoOutdatedVersion = cargo outdated --version | Take-OutputPart -Part 1
|
||||
return "Cargo outdated $cargoOutdatedVersion"
|
||||
return $cargoOutdatedVersion
|
||||
}
|
||||
|
||||
function Get-CargoClippyVersion {
|
||||
$cargoClippyVersion = $(cargo-clippy --version) | Take-OutputPart -Part 1
|
||||
return "Cargo clippy $cargoClippyVersion"
|
||||
return $cargoClippyVersion
|
||||
}
|
||||
|
||||
function Get-CbindgenVersion {
|
||||
$cbindgenVersion = $(cbindgen --version) | Take-OutputPart -Part 1
|
||||
return "Cbindgen $cbindgenVersion"
|
||||
return $cbindgenVersion
|
||||
}
|
||||
|
||||
function Get-RustupVersion {
|
||||
$rustupVersion = $(rustup --version) | Take-OutputPart -Part 1
|
||||
return "Rustup $rustupVersion"
|
||||
return $rustupVersion
|
||||
}
|
||||
|
||||
function Get-RustdocVersion {
|
||||
$rustdocVersion = $(rustdoc --version) | Take-OutputPart -Part 1
|
||||
return "Rustdoc $rustdocVersion"
|
||||
return $rustdocVersion
|
||||
}
|
||||
|
||||
function Get-RustfmtVersion {
|
||||
$rustfmtVersion = $(rustfmt --version) | Take-OutputPart -Part 1 | Take-OutputPart -Part 0 -Delimiter "-"
|
||||
return "Rustfmt $rustfmtVersion"
|
||||
return $rustfmtVersion
|
||||
}
|
||||
|
||||
@@ -1,35 +1,33 @@
|
||||
function Get-AnsibleVersion {
|
||||
$ansibleVersion = (ansible --version)[0] -replace "[^\d.]"
|
||||
return "Ansible $ansibleVersion"
|
||||
return $ansibleVersion
|
||||
}
|
||||
|
||||
function Get-AptFastVersion {
|
||||
$versionFileContent = Get-Content (which apt-fast) -Raw
|
||||
$match = [Regex]::Match($versionFileContent, '# apt-fast v(.+)\n')
|
||||
$aptFastVersion = $match.Groups[1].Value
|
||||
return "apt-fast $aptFastVersion"
|
||||
return $match.Groups[1].Value
|
||||
}
|
||||
|
||||
function Get-AzCopyVersion {
|
||||
$azcopyVersion = azcopy --version | Take-OutputPart -Part 2
|
||||
return "AzCopy $azcopyVersion - available by ``azcopy`` and ``azcopy10`` aliases"
|
||||
return "$azcopyVersion - available by ``azcopy`` and ``azcopy10`` aliases"
|
||||
}
|
||||
|
||||
function Get-BazelVersion {
|
||||
$bazelVersion = bazel --version | Select-String "bazel" | Take-OutputPart -Part 1
|
||||
return "Bazel $bazelVersion"
|
||||
return $bazelVersion
|
||||
}
|
||||
|
||||
function Get-BazeliskVersion {
|
||||
$result = Get-CommandResult "bazelisk version" -Multiline
|
||||
$bazeliskVersion = $result.Output | Select-String "Bazelisk version:" | Take-OutputPart -Part 2 | Take-OutputPart -Part 0 -Delimiter "v"
|
||||
return "Bazelisk $bazeliskVersion"
|
||||
return $bazeliskVersion
|
||||
}
|
||||
|
||||
function Get-BicepVersion {
|
||||
(bicep --version | Out-String) -match "bicep cli version (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||
$bicepVersion = $Matches.Version
|
||||
return "Bicep $bicepVersion"
|
||||
return $Matches.Version
|
||||
}
|
||||
|
||||
function Get-CodeQLBundleVersion {
|
||||
@@ -37,256 +35,256 @@ function Get-CodeQLBundleVersion {
|
||||
$CodeQLVersionPath = Get-ChildItem $CodeQLVersionsWildcard | Select-Object -First 1 -Expand FullName
|
||||
$CodeQLPath = Join-Path $CodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql"
|
||||
$CodeQLVersion = & $CodeQLPath version --quiet
|
||||
return "CodeQL Action Bundle $CodeQLVersion"
|
||||
return $CodeQLVersion
|
||||
}
|
||||
|
||||
function Get-PodManVersion {
|
||||
$podmanVersion = podman --version | Take-OutputPart -Part 2
|
||||
return "Podman $podmanVersion"
|
||||
return $podmanVersion
|
||||
}
|
||||
|
||||
function Get-BuildahVersion {
|
||||
$buildahVersion = buildah --version | Take-OutputPart -Part 2
|
||||
return "Buildah $buildahVersion"
|
||||
return $buildahVersion
|
||||
}
|
||||
|
||||
function Get-SkopeoVersion {
|
||||
$skopeoVersion = skopeo --version | Take-OutputPart -Part 2
|
||||
return "Skopeo $skopeoVersion"
|
||||
return $skopeoVersion
|
||||
}
|
||||
|
||||
function Get-CMakeVersion {
|
||||
$cmakeVersion = cmake --version | Select-Object -First 1 | Take-OutputPart -Part 2
|
||||
return "CMake $cmakeVersion"
|
||||
return $cmakeVersion
|
||||
}
|
||||
|
||||
function Get-DockerComposeV1Version {
|
||||
$composeVersion = docker-compose -v | Take-OutputPart -Part 2 | Take-OutputPart -Part 0 -Delimiter ","
|
||||
return "Docker Compose v1 $composeVersion"
|
||||
return $composeVersion
|
||||
}
|
||||
|
||||
function Get-DockerComposeV2Version {
|
||||
$composeVersion = docker compose version | Take-OutputPart -Part 3
|
||||
return "Docker Compose v2 $composeVersion"
|
||||
return $composeVersion
|
||||
}
|
||||
|
||||
function Get-DockerMobyClientVersion {
|
||||
$dockerClientVersion = sudo docker version --format '{{.Client.Version}}'
|
||||
return "Docker-Moby Client $dockerClientVersion"
|
||||
return $dockerClientVersion
|
||||
}
|
||||
|
||||
function Get-DockerMobyServerVersion {
|
||||
$dockerServerVersion = sudo docker version --format '{{.Server.Version}}'
|
||||
return "Docker-Moby Server $dockerServerVersion"
|
||||
return $dockerServerVersion
|
||||
}
|
||||
|
||||
function Get-DockerBuildxVersion {
|
||||
$buildxVersion = docker buildx version | Take-OutputPart -Part 1 | Take-OutputPart -Part 0 -Delimiter "+"
|
||||
return "Docker-Buildx $buildxVersion"
|
||||
return $buildxVersion
|
||||
}
|
||||
|
||||
function Get-DockerAmazonECRCredHelperVersion {
|
||||
$ecrVersion = docker-credential-ecr-login -v | Select-String "Version:" | Take-OutputPart -Part 1
|
||||
return "Docker Amazon ECR Credential Helper $ecrVersion"
|
||||
return $ecrVersion
|
||||
}
|
||||
|
||||
function Get-GitVersion {
|
||||
$gitVersion = git --version | Take-OutputPart -Part -1
|
||||
return "Git $gitVersion"
|
||||
return $gitVersion
|
||||
}
|
||||
|
||||
function Get-GitLFSVersion {
|
||||
$result = Get-CommandResult "git-lfs --version"
|
||||
$gitlfsversion = $result.Output | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/"
|
||||
return "Git LFS $gitlfsversion"
|
||||
return $gitlfsversion
|
||||
}
|
||||
|
||||
function Get-GitFTPVersion {
|
||||
$gitftpVersion = git-ftp --version | Take-OutputPart -Part 2
|
||||
return "Git-ftp $gitftpVersion"
|
||||
return $gitftpVersion
|
||||
}
|
||||
|
||||
function Get-GoogleCloudSDKVersion {
|
||||
return gcloud --version | Select-Object -First 1
|
||||
return (gcloud --version | Select-Object -First 1) | Take-OutputPart -Part 3
|
||||
}
|
||||
|
||||
function Get-HavegedVersion {
|
||||
$havegedVersion = dpkg-query --showformat='${Version}' --show haveged | Take-OutputPart -Part 0 -Delimiter "-"
|
||||
return "Haveged $havegedVersion"
|
||||
return $havegedVersion
|
||||
}
|
||||
|
||||
function Get-HerokuVersion {
|
||||
$herokuVersion = heroku version | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/"
|
||||
return "Heroku $herokuVersion"
|
||||
return $herokuVersion
|
||||
}
|
||||
|
||||
function Get-HHVMVersion {
|
||||
$hhvmVersion = hhvm --version | Select-Object -First 1 | Take-OutputPart -Part 2
|
||||
return "HHVM (HipHop VM) $hhvmVersion"
|
||||
return $hhvmVersion
|
||||
}
|
||||
|
||||
function Get-SVNVersion {
|
||||
$svnVersion = svn --version | Select-Object -First 1 | Take-OutputPart -Part 2
|
||||
return "SVN $svnVersion"
|
||||
return $svnVersion
|
||||
}
|
||||
|
||||
function Get-KustomizeVersion {
|
||||
$kustomizeVersion = kustomize version --short | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "v"
|
||||
return "Kustomize $kustomizeVersion"
|
||||
return $kustomizeVersion
|
||||
}
|
||||
|
||||
function Get-KindVersion {
|
||||
$kindVersion = kind version | Take-OutputPart -Part 1 | Take-OutputPart -Part 0 -Delimiter "v"
|
||||
return "Kind $kindVersion"
|
||||
return $kindVersion
|
||||
}
|
||||
|
||||
function Get-KubectlVersion {
|
||||
$kubectlVersion = (kubectl version --client --output=json | ConvertFrom-Json).clientVersion.gitVersion.Replace('v','')
|
||||
return "Kubectl $kubectlVersion"
|
||||
return $kubectlVersion
|
||||
}
|
||||
|
||||
function Get-MinikubeVersion {
|
||||
$minikubeVersion = minikube version --short | Take-OutputPart -Part 0 -Delimiter "v"
|
||||
return "Minikube $minikubeVersion"
|
||||
return $minikubeVersion
|
||||
}
|
||||
|
||||
function Get-HGVersion {
|
||||
$hgVersion = hg --version | Select-Object -First 1 | Take-OutputPart -Part -1 | Take-OutputPart -Part 0 -Delimiter ")"
|
||||
return "Mercurial $hgVersion"
|
||||
return $hgVersion
|
||||
}
|
||||
|
||||
function Get-LeiningenVersion {
|
||||
return "$(lein -v | Take-OutputPart -Part 0,1)"
|
||||
return "$(lein -v | Take-OutputPart -Part 1)"
|
||||
}
|
||||
|
||||
function Get-MediainfoVersion {
|
||||
$mediainfoVersion = (mediainfo --version | Select-Object -Index 1 | Take-OutputPart -Part 2).Replace('v', '')
|
||||
return "MediaInfo $mediainfoVersion"
|
||||
return $mediainfoVersion
|
||||
}
|
||||
|
||||
function Get-NewmanVersion {
|
||||
return "Newman $(newman --version)"
|
||||
return $(newman --version)
|
||||
}
|
||||
|
||||
function Get-NVersion {
|
||||
$nVersion = (n --version).Replace('v', '')
|
||||
return "n $nVersion"
|
||||
return $nVersion
|
||||
}
|
||||
|
||||
function Get-NvmVersion {
|
||||
$nvmVersion = bash -c "source /etc/skel/.nvm/nvm.sh && nvm --version"
|
||||
return "nvm $nvmVersion"
|
||||
return $nvmVersion
|
||||
}
|
||||
|
||||
function Get-PackerVersion {
|
||||
# Packer 1.7.1 has a bug and outputs version to stderr instead of stdout https://github.com/hashicorp/packer/issues/10855
|
||||
$result = (Get-CommandResult "packer --version").Output
|
||||
$packerVersion = [regex]::matches($result, "(\d+.){2}\d+").Value
|
||||
return "Packer $packerVersion"
|
||||
return $packerVersion
|
||||
}
|
||||
|
||||
function Get-PhantomJSVersion {
|
||||
return "PhantomJS $(phantomjs --version)"
|
||||
return $(phantomjs --version)
|
||||
}
|
||||
|
||||
function Get-TerraformVersion {
|
||||
return (terraform version | Select-String "^Terraform").Line.Replace('v','')
|
||||
return (terraform version | Select-String "^Terraform").Line.Replace('v','') | Take-OutputPart -Part 1
|
||||
}
|
||||
|
||||
function Get-JqVersion {
|
||||
$jqVersion = jq --version | Take-OutputPart -Part 1 -Delimiter "-"
|
||||
return "jq $jqVersion"
|
||||
return $jqVersion
|
||||
}
|
||||
|
||||
function Get-AzureCliVersion {
|
||||
$azcliVersion = (az version | ConvertFrom-Json).'azure-cli'
|
||||
return "Azure CLI $azcliVersion"
|
||||
return $azcliVersion
|
||||
}
|
||||
|
||||
function Get-AzureDevopsVersion {
|
||||
$azdevopsVersion = (az version | ConvertFrom-Json).extensions.'azure-devops'
|
||||
return "Azure CLI (azure-devops) $azdevopsVersion"
|
||||
return $azdevopsVersion
|
||||
}
|
||||
|
||||
function Get-AlibabaCloudCliVersion {
|
||||
return "Alibaba Cloud CLI $(aliyun version)"
|
||||
return $(aliyun version)
|
||||
}
|
||||
|
||||
function Get-AWSCliVersion {
|
||||
$result = Get-CommandResult "aws --version"
|
||||
$awsVersion = $result.Output | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/"
|
||||
return "AWS CLI $awsVersion"
|
||||
return $awsVersion
|
||||
}
|
||||
|
||||
function Get-AWSCliSessionManagerPluginVersion {
|
||||
$result = (Get-CommandResult "session-manager-plugin --version").Output
|
||||
return "AWS CLI Session manager plugin $result"
|
||||
return $result
|
||||
}
|
||||
|
||||
function Get-AWSSAMVersion {
|
||||
return "AWS SAM CLI $(sam --version | Take-OutputPart -Part -1)"
|
||||
return $(sam --version | Take-OutputPart -Part -1)
|
||||
}
|
||||
|
||||
function Get-FastlaneVersion {
|
||||
$fastlaneVersion = fastlane --version | Select-String "^fastlane [0-9]" | Take-OutputPart -Part 1
|
||||
return "Fastlane $fastlaneVersion"
|
||||
return $fastlaneVersion
|
||||
}
|
||||
|
||||
function Get-HubCliVersion {
|
||||
$hubVersion = hub --version | Select-String "hub version" | Take-OutputPart -Part 2
|
||||
return "Hub CLI $hubVersion"
|
||||
return $hubVersion
|
||||
}
|
||||
|
||||
function Get-GitHubCliVersion {
|
||||
$ghVersion = gh --version | Select-String "gh version" | Take-OutputPart -Part 2
|
||||
return "GitHub CLI $ghVersion"
|
||||
return $ghVersion
|
||||
}
|
||||
|
||||
function Get-NetlifyCliVersion {
|
||||
$netlifyVersion = netlify --version | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/"
|
||||
return "Netlify CLI $netlifyVersion"
|
||||
return $netlifyVersion
|
||||
}
|
||||
|
||||
function Get-OCCliVersion {
|
||||
$ocVersion = oc version -o=json | jq -r '.releaseClientVersion'
|
||||
return "OpenShift CLI $ocVersion"
|
||||
return $ocVersion
|
||||
}
|
||||
|
||||
function Get-ORASCliVersion {
|
||||
$orasVersion = oras version | Select-String "^Version:" | Take-OutputPart -Part 1
|
||||
return "ORAS CLI $orasVersion"
|
||||
return $orasVersion
|
||||
}
|
||||
|
||||
function Get-VerselCliversion {
|
||||
$result = Get-CommandResult "vercel --version" -Multiline
|
||||
return $result.Output | Select-Object -First 1
|
||||
return $result.Output | Select-Object -Skip 1 -First 1
|
||||
}
|
||||
|
||||
function Get-PulumiVersion {
|
||||
$pulumiVersion = pulumi version | Take-OutputPart -Part 0 -Delimiter "v"
|
||||
return "Pulumi $pulumiVersion"
|
||||
return $pulumiVersion
|
||||
}
|
||||
|
||||
function Get-RVersion {
|
||||
$rVersion = (Get-CommandResult "R --version | grep 'R version'").Output | Take-OutputPart -Part 2
|
||||
return "R $rVersion"
|
||||
return $rVersion
|
||||
}
|
||||
|
||||
function Get-SphinxVersion {
|
||||
$sphinxVersion = searchd -h | Select-Object -First 1 | Take-OutputPart -Part 1 | Take-OutputPart -Part 0 -Delimiter "-"
|
||||
return "Sphinx Open Source Search Server $sphinxVersion"
|
||||
return $sphinxVersion
|
||||
}
|
||||
|
||||
function Get-YamllintVersion {
|
||||
return "$(yamllint --version)"
|
||||
return $(yamllint --version) | Take-OutputPart -Part 1
|
||||
}
|
||||
|
||||
function Get-ZstdVersion {
|
||||
$zstdVersion = zstd --version | Take-OutputPart -Part 1 -Delimiter "v" | Take-OutputPart -Part 0 -Delimiter ","
|
||||
return "zstd $zstdVersion (Homebrew)"
|
||||
return "$zstdVersion (Homebrew)"
|
||||
}
|
||||
|
||||
function Get-YqVersion {
|
||||
$yqVersion = ($(yq -V) -Split " ")[-1]
|
||||
return "yq $yqVersion"
|
||||
return $yqVersion
|
||||
}
|
||||
@@ -43,19 +43,13 @@ function Get-Xsp4Version {
|
||||
}
|
||||
}
|
||||
|
||||
function Build-WebServersSection {
|
||||
$servers = @(
|
||||
(Get-ApacheVersion),
|
||||
(Get-NginxVersion)
|
||||
)
|
||||
function Build-WebServersTable {
|
||||
$servers = @()
|
||||
$servers += (Get-ApacheVersion)
|
||||
if (Test-IsUbuntu20) {
|
||||
$servers += (Get-Xsp4Version)
|
||||
}
|
||||
$servers += (Get-NginxVersion)
|
||||
|
||||
$output = ""
|
||||
$output += New-MDHeader "Web Servers" -Level 3
|
||||
$output += $servers | Sort-Object Name | New-MDTable
|
||||
$output += New-MDNewLine
|
||||
|
||||
return $output
|
||||
return $servers
|
||||
}
|
||||
|
||||
@@ -10,14 +10,6 @@ function Take-OutputPart {
|
||||
return [string]::Join($Delimiter, $selectedParts)
|
||||
}
|
||||
|
||||
function New-MDNewLine {
|
||||
param (
|
||||
[int] $Count = 1
|
||||
)
|
||||
$newLineSymbol = [System.Environment]::NewLine
|
||||
return $newLineSymbol * $Count
|
||||
}
|
||||
|
||||
function Restore-UserOwner {
|
||||
sudo chown -R ${env:USER}: $env:HOME
|
||||
}
|
||||
@@ -41,118 +33,9 @@ function Get-PathWithLink {
|
||||
return "${inputPath}${link}"
|
||||
}
|
||||
|
||||
function Get-CachedToolInstances
|
||||
{
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Returns hastable of installed cached tools.
|
||||
|
||||
.DESCRIPTION
|
||||
Return hastable that contains versions and architectures for selected cached tool.
|
||||
|
||||
.PARAMETER Name
|
||||
Name of cached tool.
|
||||
|
||||
.PARAMETER VersionCommand
|
||||
Optional parameter. Command to return version of system default tool.
|
||||
|
||||
.EXAMPLE
|
||||
Get-CachedToolInstances -Name "Python" -VersionCommand "--version"
|
||||
|
||||
#>
|
||||
|
||||
param
|
||||
(
|
||||
[String] $Name,
|
||||
[String] $VersionCommand
|
||||
)
|
||||
|
||||
$toolInstances = @()
|
||||
$toolPath = Join-Path -Path $env:AGENT_TOOLSDIRECTORY -ChildPath $Name
|
||||
|
||||
# Get all installed versions from TOOLSDIRECTORY folder
|
||||
$versions = Get-ChildItem $toolPath | Sort-Object { [System.Version]$_.Name }
|
||||
foreach ($version in $versions)
|
||||
{
|
||||
$instanceInfo = @{}
|
||||
|
||||
# Create instance hashtable
|
||||
[string]$instanceInfo.Path = Join-Path -Path $toolPath -ChildPath $version.Name
|
||||
[string]$instanceInfo.Version = $version.Name
|
||||
|
||||
# Get all architectures for current version
|
||||
[array]$instanceInfo.Architecture_Array = Get-ChildItem $version.FullName -Name -Directory | Where-Object { $_ -match "^x[0-9]{2}$" }
|
||||
[string]$instanceInfo.Architecture = $instanceInfo.Architecture_Array -Join ", "
|
||||
|
||||
# Add (default) postfix to version name, in case if current version is in environment path
|
||||
if (-not ([string]::IsNullOrEmpty($VersionCommand)))
|
||||
{
|
||||
$defaultVersion = $(& ($Name.ToLower()) $VersionCommand 2>&1)
|
||||
$defaultToolVersion = $defaultVersion | Select-String -Pattern "\d+\.\d+\.\d+" -AllMatches `
|
||||
| ForEach-Object { $_.Matches.Value }
|
||||
|
||||
if ([version]$version.Name -eq [version]$defaultToolVersion)
|
||||
{
|
||||
$instanceInfo.Version += " (Default)"
|
||||
}
|
||||
}
|
||||
|
||||
$toolInstances += $instanceInfo
|
||||
}
|
||||
|
||||
return $toolInstances
|
||||
}
|
||||
|
||||
function Get-AptSourceRepository {
|
||||
param([String] $PackageName)
|
||||
|
||||
$sourceUrl = Get-Content "$PSScriptRoot/../helpers/apt-sources.txt" | Select-String -Pattern $PackageName | Take-OutputPart -Part (1..3)
|
||||
return $sourceUrl
|
||||
}
|
||||
|
||||
function Test-BlankElement {
|
||||
param(
|
||||
[string] $Markdown
|
||||
)
|
||||
|
||||
$splitByLines = $Markdown.Split("`n")
|
||||
# Validate entry without version
|
||||
$blankVersions = $splitByLines -match "^-" -notmatch "Image Version|MySQL Server|Vcpkg|\d\." | Out-String
|
||||
|
||||
# Validate tables with blank rows
|
||||
$blankRows = ""
|
||||
for($i = 0; $i -lt $splitByLines.Length; $i++) {
|
||||
$addRows= $false
|
||||
$table = @()
|
||||
if ($splitByLines[$i].StartsWith("#") -and $splitByLines[$i+1].StartsWith("|")) {
|
||||
$table += $splitByLines[$i,($i+1),($i+2)]
|
||||
$i += 3
|
||||
$current = $splitByLines[$i]
|
||||
while ($current.StartsWith("|")) {
|
||||
$isBlankRow = $current.Substring(1, $current.LastIndexOf("|") - 2).Split("|").Trim() -contains ""
|
||||
if ($isBlankRow) {
|
||||
$table += $current
|
||||
$addRows = $true
|
||||
}
|
||||
$current = $splitByLines[++$i]
|
||||
}
|
||||
if ($addRows) {
|
||||
$blankRows += $table | Out-String
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Display report
|
||||
$isReport = $false
|
||||
if ($blankVersions) {
|
||||
Write-Host "Software list with blank version:`n${blankVersions}"
|
||||
$isReport = $true
|
||||
}
|
||||
if ($blankRows) {
|
||||
Write-Host "Tables with blank rows:`n${blankRows}"
|
||||
$isReport = $true
|
||||
}
|
||||
if ($isReport) {
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,6 +120,11 @@
|
||||
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
||||
"destination": "{{user `image_folder`}}"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{ template_dir }}/../../helpers/software-report-base",
|
||||
"destination": "{{user `image_folder`}}/SoftwareReport/"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{template_dir}}/toolsets/toolset-1804.json",
|
||||
@@ -331,10 +336,16 @@
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{user `image_folder`}}/Ubuntu-Readme.md",
|
||||
"source": "{{user `image_folder`}}/software-report.md",
|
||||
"destination": "{{template_dir}}/Ubuntu1804-Readme.md",
|
||||
"direction": "download"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{user `image_folder`}}/software-report.json",
|
||||
"destination": "{{template_dir}}/software-report.json",
|
||||
"direction": "download"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"scripts":[
|
||||
|
||||
@@ -120,6 +120,11 @@
|
||||
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
||||
"destination": "{{user `image_folder`}}"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{ template_dir }}/../../helpers/software-report-base",
|
||||
"destination": "{{user `image_folder`}}/SoftwareReport/"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{template_dir}}/toolsets/toolset-2004.json",
|
||||
@@ -336,10 +341,16 @@
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{user `image_folder`}}/Ubuntu-Readme.md",
|
||||
"source": "{{user `image_folder`}}/software-report.md",
|
||||
"destination": "{{template_dir}}/Ubuntu2004-Readme.md",
|
||||
"direction": "download"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"source": "{{user `image_folder`}}/software-report.json",
|
||||
"destination": "{{template_dir}}/software-report.json",
|
||||
"direction": "download"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"scripts":[
|
||||
|
||||
@@ -234,6 +234,11 @@ build {
|
||||
source = "${path.root}/scripts/SoftwareReport"
|
||||
}
|
||||
|
||||
provisioner "file" {
|
||||
destination = "${var.image_folder}/SoftwareReport/"
|
||||
source = "${path.root}/../../helpers/software-report-base"
|
||||
}
|
||||
|
||||
provisioner "file" {
|
||||
destination = "${var.installer_script_folder}/toolset.json"
|
||||
source = "${path.root}/toolsets/toolset-2204.json"
|
||||
@@ -382,7 +387,13 @@ build {
|
||||
provisioner "file" {
|
||||
destination = "${path.root}/Ubuntu2204-Readme.md"
|
||||
direction = "download"
|
||||
source = "${var.image_folder}/Ubuntu-Readme.md"
|
||||
source = "${var.image_folder}/software-report.md"
|
||||
}
|
||||
|
||||
provisioner "file" {
|
||||
destination = "${path.root}/software-report.json"
|
||||
direction = "download"
|
||||
source = "${var.image_folder}/software-report.json"
|
||||
}
|
||||
|
||||
provisioner "shell" {
|
||||
|
||||
Reference in New Issue
Block a user