[Ubuntu] Install zstd homebrew (#3181)

* install zstd using brew

* fix typo

* remove Run-Command

* replace to Take-OutputPart

* create zstd symlinks
This commit is contained in:
Aleksandr Chebotov
2021-04-14 19:34:49 +03:00
committed by GitHub
parent 16fd521369
commit b04de88f6e
7 changed files with 36 additions and 4 deletions

View File

@@ -130,7 +130,8 @@ $toolsList = @(
(Get-PulumiVersion),
(Get-RVersion),
(Get-SphinxVersion),
(Get-TerraformVersion)
(Get-TerraformVersion),
(Get-ZstdVersion)
)
if (-not (Test-IsUbuntu16)) {

View File

@@ -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)"
}

View File

@@ -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"

View File

@@ -225,6 +225,14 @@ Describe "Homebrew" {
It "homebrew" {
"brew --version" | Should -ReturnZeroExitCode
}
Context "Packages" {
$testCases = (Get-ToolsetContent).brew | ForEach-Object { @{ ToolName = $_.name } }
It "<ToolName>" -TestCases $testCases {
"$ToolName --version" | Should -Not -BeNullOrEmpty
}
}
}
Describe "Julia" {

View File

@@ -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",

View File

@@ -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",

View File

@@ -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",