mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 06:08:07 +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,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
|
||||
}
|
||||
Reference in New Issue
Block a user