From d0524e9381ba12bb4a7c8ee8173bd7e9e8c7ea43 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Tue, 22 Sep 2020 12:12:44 +0300 Subject: [PATCH 1/4] exclude R and virtualbox --- images/macos/provision/core/commonutils.sh | 19 +++++++++++++------ .../SoftwareReport.Generator.ps1 | 16 +++++++++++----- images/macos/tests/Common.Tests.ps1 | 18 +++++++++--------- 3 files changed, 33 insertions(+), 20 deletions(-) diff --git a/images/macos/provision/core/commonutils.sh b/images/macos/provision/core/commonutils.sh index 2f2a18ce..7bd55dfd 100644 --- a/images/macos/provision/core/commonutils.sh +++ b/images/macos/provision/core/commonutils.sh @@ -40,12 +40,19 @@ for package in ${binst_common_utils[@]}; do done # brew cask install -bcask_common_utils=( - julia - virtualbox - vagrant - r -) +if is_BigSur; then + bcask_common_utils=( + julia + vagrant + ) +else + bcask_common_utils=( + julia + virtualbox + vagrant + r + ) +fi for package in ${bcask_common_utils[@]}; do echo "Install $package" diff --git a/images/macos/software-report/SoftwareReport.Generator.ps1 b/images/macos/software-report/SoftwareReport.Generator.ps1 index b8a5283c..eed6c06e 100644 --- a/images/macos/software-report/SoftwareReport.Generator.ps1 +++ b/images/macos/software-report/SoftwareReport.Generator.ps1 @@ -55,6 +55,10 @@ if ( -not $os.IsHighSierra) { $markdown += New-MDList -Style Unordered -NoNewLine -Lines $lines } +if ($os.IsLessThanBigSur) { + $markdown += New-MDList -Style Unordered -Lines @(Get-RVersion) -NoNewLine +} + $markdown += New-MDList -Style Unordered -Lines @( "Node.js ${nodejsVersion}" "NVM ${nvmVersion}" @@ -63,7 +67,6 @@ $markdown += New-MDList -Style Unordered -Lines @( $python3Version, "Ruby ${rubyVersion}", (Get-DotnetVersionList), - (Get-RVersion), "Go ${goVersion}", "$phpVersion", "$juliaVersion" @@ -139,7 +142,6 @@ $bazelVersion = Run-Command "bazel --version" | Take-Part -Part 0 -Delimiter "-" $bazeliskVersion = Run-Command "bazelisk version" | Select-String "Bazelisk version:" | Take-Part -Part 1 -Delimiter ":" $packerVersion = Run-Command "packer --version" $helmVersion = Run-Command "helm version --short" -$vbox = Run-Command "vboxmanage -v" $vagrant = Run-Command "vagrant -v" $mongo = Run-Command "mongo --version" | Select-String "MongoDB shell version" | Take-Part -Part 3 $mongod = Run-Command "mongod --version" | Select-String "db version " | Take-Part -Part 2 @@ -177,8 +179,12 @@ if ($os.IsHigherThanMojave) { $markdown += New-MDList -Lines "Newman $newmanVersion" -Style Unordered -NoNewLine } if ($os.IsLessThanBigSur) { + $vbox = Run-Command "vboxmanage -v" $parallelVersion = Run-Command "parallel --version" | Select-String "GNU parallel" | Select-Object -First 1 - $markdown += New-MDList -Lines $parallelVersion -Style Unordered + $markdown += New-MDList -Style Unordered -Lines @( + $vbox + $parallelVersion + ) } $markdown += New-MDNewLine @@ -190,9 +196,9 @@ $azureCLIVersion = Run-Command "az -v" | Select-String "^azure-cli" | Take-Part $awsVersion = Run-Command "aws --version" | Take-Part -Part 0 | Take-Part -Delimiter "/" -Part 1 $aliyunVersion = Run-Command "aliyun --version" | Select-String "Alibaba Cloud Command Line Interface Version " | Take-Part -Part 6 $awsSamVersion = Run-Command "sam --version" | Take-Part -Part 3 -$awsSessionManagerVersion = Run-Command "session-manager-plugin --version" +$awsSessionManagerVersion = Run-Command "session-manager-plugin --version" $ghcUpVersion = Run-Command "ghcup --version" | Take-Part -Part 5 -$ghcVersion = Run-Command "ghc --version" | Take-Part -Part 7 +$ghcVersion = Run-Command "ghc --version" | Take-Part -Part 7 $cabalVersion = Run-Command "cabal --version" | Take-Part -Part 3 $stackVersion = Run-Command "stack --version" | Take-Part -Part 1 | ForEach-Object {$_.replace(",","")} diff --git a/images/macos/tests/Common.Tests.ps1 b/images/macos/tests/Common.Tests.ps1 index 3e61a9a8..505c5736 100644 --- a/images/macos/tests/Common.Tests.ps1 +++ b/images/macos/tests/Common.Tests.ps1 @@ -103,7 +103,7 @@ Describe "Common utilities" { $result = Get-CommandResult "gem list" $result.Output | Should -BeLike "*nomad-cli*" } - + It "Nomad CLI IPA" { "ipa --version" | Should -ReturnZeroExitCode } @@ -163,7 +163,7 @@ Describe "Common utilities" { It "PostgreSQL-Client" { "psql --version" | Should -ReturnZeroExitCode } - + It "PostgreSQL-Server" { "pg_config --version" | Should -ReturnZeroExitCode } @@ -180,11 +180,11 @@ Describe "Common utilities" { Get-WhichTool "php" | Should -Not -BeLike "/usr/bin/php*" "php --version" | Should -ReturnZeroExitCode } - + It "Composer" { "composer --version" | Should -ReturnZeroExitCode } - + It "R" -Skip:($os.IsBigSur) { "R --version" | Should -ReturnZeroExitCode } @@ -200,7 +200,7 @@ Describe "Common utilities" { It "bazelisk" { "bazelisk version" | Should -ReturnZeroExitCode } - + It "Julia" { "julia --version" | Should -ReturnZeroExitCode } @@ -213,7 +213,7 @@ Describe "Common utilities" { "helm version --short" | Should -ReturnZeroExitCode } - It "virtualbox" { + It "virtualbox" -Skip:($os.IsBigSur) { "vboxmanage -v" | Should -ReturnZeroExitCode } @@ -254,7 +254,7 @@ Describe "Browsers" { It "Microsoft Edge Driver" { "msedgedriver --version" | Should -ReturnZeroExitCode } - + It "Firefox" { $firefoxLocation = "/Applications/Firefox.app/Contents/MacOS/firefox" $firefoxLocation | Should -Exist @@ -306,7 +306,7 @@ Describe "Haskell" -Skip:($os.IsHighSierra) { It "GHC" { "ghc --version" | Should -ReturnZeroExitCode } - + It "Cabal" { "cabal --version" | Should -ReturnZeroExitCode } @@ -329,7 +329,7 @@ Describe "Gcc" -Skip:($os.IsHighSierra) { param ( [string] $GccVersion ) - + "gcc-$GccVersion --version" | Should -ReturnZeroExitCode } } From 907a61cd2fb01af3aed01d1f66148582163c11d2 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Tue, 22 Sep 2020 12:30:15 +0300 Subject: [PATCH 2/4] exclude vagrant --- images/macos/provision/core/commonutils.sh | 1 - images/macos/software-report/SoftwareReport.Generator.ps1 | 7 +++---- images/macos/tests/Common.Tests.ps1 | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/images/macos/provision/core/commonutils.sh b/images/macos/provision/core/commonutils.sh index 7bd55dfd..439a0106 100644 --- a/images/macos/provision/core/commonutils.sh +++ b/images/macos/provision/core/commonutils.sh @@ -43,7 +43,6 @@ done if is_BigSur; then bcask_common_utils=( julia - vagrant ) else bcask_common_utils=( diff --git a/images/macos/software-report/SoftwareReport.Generator.ps1 b/images/macos/software-report/SoftwareReport.Generator.ps1 index eed6c06e..9a8ada4a 100644 --- a/images/macos/software-report/SoftwareReport.Generator.ps1 +++ b/images/macos/software-report/SoftwareReport.Generator.ps1 @@ -142,7 +142,6 @@ $bazelVersion = Run-Command "bazel --version" | Take-Part -Part 0 -Delimiter "-" $bazeliskVersion = Run-Command "bazelisk version" | Select-String "Bazelisk version:" | Take-Part -Part 1 -Delimiter ":" $packerVersion = Run-Command "packer --version" $helmVersion = Run-Command "helm version --short" -$vagrant = Run-Command "vagrant -v" $mongo = Run-Command "mongo --version" | Select-String "MongoDB shell version" | Take-Part -Part 3 $mongod = Run-Command "mongod --version" | Select-String "db version " | Take-Part -Part 2 $p7zip = Run-Command "7z i" | Select-String "7-Zip" | Take-Part -Part 0,2 @@ -168,10 +167,8 @@ $markdown += New-MDList -Style Unordered -NoNewLine -Lines @( $bazelVersion, "bazelisk $($bazeliskVersion.Trim())", "helm $helmVersion", - "virtualbox $vbox", "mongo $mongo", "mongod $mongod", - "$vagrant", $p7zip ) if ($os.IsHigherThanMojave) { @@ -179,10 +176,12 @@ if ($os.IsHigherThanMojave) { $markdown += New-MDList -Lines "Newman $newmanVersion" -Style Unordered -NoNewLine } if ($os.IsLessThanBigSur) { + $vagrant = Run-Command "vagrant -v" $vbox = Run-Command "vboxmanage -v" $parallelVersion = Run-Command "parallel --version" | Select-String "GNU parallel" | Select-Object -First 1 $markdown += New-MDList -Style Unordered -Lines @( - $vbox + "virtualbox $vbox", + $vagrant, $parallelVersion ) } diff --git a/images/macos/tests/Common.Tests.ps1 b/images/macos/tests/Common.Tests.ps1 index 505c5736..b6c5b099 100644 --- a/images/macos/tests/Common.Tests.ps1 +++ b/images/macos/tests/Common.Tests.ps1 @@ -217,7 +217,7 @@ Describe "Common utilities" { "vboxmanage -v" | Should -ReturnZeroExitCode } - It "vagrant" { + It "vagrant" -Skip:($os.IsBigSur) { "vagrant --version" | Should -ReturnZeroExitCode } From adf9c70bd92b5004b4f10ca9a3e93b35366655d0 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Tue, 22 Sep 2020 12:32:31 +0300 Subject: [PATCH 3/4] package condition --- images/macos/provision/core/commonutils.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/images/macos/provision/core/commonutils.sh b/images/macos/provision/core/commonutils.sh index 439a0106..9d05bcfb 100644 --- a/images/macos/provision/core/commonutils.sh +++ b/images/macos/provision/core/commonutils.sh @@ -40,13 +40,11 @@ for package in ${binst_common_utils[@]}; do done # brew cask install -if is_BigSur; then - bcask_common_utils=( - julia - ) -else - bcask_common_utils=( - julia +bcask_common_utils=( + julia +) +if is_Less_BigSur; then + bcask_common_utils+=( virtualbox vagrant r From 49763bcc9da89d62b4ebf4fdfee4abdd5c870c43 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Tue, 22 Sep 2020 12:33:10 +0300 Subject: [PATCH 4/4] new line --- images/macos/provision/core/commonutils.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/images/macos/provision/core/commonutils.sh b/images/macos/provision/core/commonutils.sh index 9d05bcfb..9b32d5c2 100644 --- a/images/macos/provision/core/commonutils.sh +++ b/images/macos/provision/core/commonutils.sh @@ -43,6 +43,7 @@ done bcask_common_utils=( julia ) + if is_Less_BigSur; then bcask_common_utils+=( virtualbox