diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index cc4a74a01..e597aa232 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -130,7 +130,8 @@ $toolsList = @( (Get-PulumiVersion), (Get-RVersion), (Get-SphinxVersion), - (Get-TerraformVersion) + (Get-TerraformVersion), + (Get-ZstdVersion) ) if (-not (Test-IsUbuntu16)) { diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index c0b5de04c..1473b0945 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -263,3 +263,8 @@ function Get-SphinxVersion { function Get-YamllintVersion { return "$(yamllint --version)" } + +function Get-ZstdVersion { + $zstdVersion = zstd --version | Take-OutputPart -Part 1 -Delimiter "v" | Take-OutputPart -Part 0 -Delimiter "," + return "zstd $zstdVersion (homebrew)" +} diff --git a/images/linux/scripts/installers/homebrew.sh b/images/linux/scripts/installers/homebrew.sh index 00d8157f5..3c325b1bb 100644 --- a/images/linux/scripts/installers/homebrew.sh +++ b/images/linux/scripts/installers/homebrew.sh @@ -7,6 +7,7 @@ # Source the helpers source $HELPER_SCRIPTS/etc-environment.sh +source $HELPER_SCRIPTS/install.sh # Install the Homebrew on Linux /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" @@ -25,4 +26,15 @@ setEtcEnvironmentVariable HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS 3650 echo "Validate the installation reloading /etc/environment" reloadEtcEnvironment +# Install additional brew packages +brew_packages=$(get_toolset_value .brew[].name) +for package in $brew_packages; do + echo "Install $package" + brew install $package + # create symlinks for zstd in /usr/local/bin + if [[ $package == "zstd" ]]; then + find $(brew --prefix)/bin -name *zstd* -exec sudo sh -c 'ln -s {} /usr/local/bin/$(basename {})' ';' + fi +done + invoke_tests "Tools" "Homebrew" diff --git a/images/linux/scripts/tests/Tools.Tests.ps1 b/images/linux/scripts/tests/Tools.Tests.ps1 index 8ec4deb31..12d95b751 100644 --- a/images/linux/scripts/tests/Tools.Tests.ps1 +++ b/images/linux/scripts/tests/Tools.Tests.ps1 @@ -225,6 +225,14 @@ Describe "Homebrew" { It "homebrew" { "brew --version" | Should -ReturnZeroExitCode } + + Context "Packages" { + $testCases = (Get-ToolsetContent).brew | ForEach-Object { @{ ToolName = $_.name } } + + It "" -TestCases $testCases { + "$ToolName --version" | Should -Not -BeNullOrEmpty + } + } } Describe "Julia" { diff --git a/images/linux/toolsets/toolset-1604.json b/images/linux/toolsets/toolset-1604.json index 4586c0ace..1faaceb08 100644 --- a/images/linux/toolsets/toolset-1604.json +++ b/images/linux/toolsets/toolset-1604.json @@ -161,7 +161,6 @@ "xorriso", "xvfb", "xz-utils", - "zstd", "zsync" ], "cmd_packages": [ @@ -202,6 +201,9 @@ "zip" ] }, + "brew": [ + {"name": "zstd"} + ], "docker": { "images": [ "alpine:3.11", diff --git a/images/linux/toolsets/toolset-1804.json b/images/linux/toolsets/toolset-1804.json index aca49af12..3df858b0d 100644 --- a/images/linux/toolsets/toolset-1804.json +++ b/images/linux/toolsets/toolset-1804.json @@ -155,7 +155,6 @@ "xorriso", "xvfb", "xz-utils", - "zstd", "zsync" ], "cmd_packages": [ @@ -195,6 +194,9 @@ "zip" ] }, + "brew": [ + {"name": "zstd"} + ], "docker": { "images": [ "alpine:3.11", diff --git a/images/linux/toolsets/toolset-2004.json b/images/linux/toolsets/toolset-2004.json index c7ae0859b..790509405 100644 --- a/images/linux/toolsets/toolset-2004.json +++ b/images/linux/toolsets/toolset-2004.json @@ -154,7 +154,6 @@ "xorriso", "xvfb", "xz-utils", - "zstd", "zsync" ], "cmd_packages": [ @@ -195,6 +194,9 @@ "zip" ] }, + "brew": [ + {"name": "zstd"} + ], "docker": { "images": [ "alpine:3.11",