[macOS] Move Ruby and Go versions to toolset (#4046)

This commit is contained in:
Dibir Magomedsaygitov
2021-09-10 14:41:17 +03:00
committed by GitHub
parent 045e638562
commit d022b0d6a8
15 changed files with 81 additions and 39 deletions

View File

@@ -19,9 +19,6 @@ if is_Less_Catalina; then
echo "export USE_BAZEL_VERSION=${USE_BAZEL_VERSION}" >> "${HOME}/.bashrc" echo "export USE_BAZEL_VERSION=${USE_BAZEL_VERSION}" >> "${HOME}/.bashrc"
fi fi
# Create symlinks for Go 1.15 to preserve backward compatibility
ln -sf $(brew --prefix go@1.15)/bin/* /usr/local/bin/
# Invoke bazel to download bazel version via bazelisk # Invoke bazel to download bazel version via bazelisk
bazel bazel

View File

@@ -0,0 +1,11 @@
#!/bin/bash -e -o pipefail
source ~/utils/utils.sh
DEFAULT_GO_VERSION=$(get_toolset_value '.go.default')
echo "Installing Go..."
brew_smart_install "go@${DEFAULT_GO_VERSION}"
# Create symlinks to preserve backward compatibility. Symlinks are not created when non-latest go is being installed
ln -sf $(brew --prefix go@${DEFAULT_GO_VERSION})/bin/* /usr/local/bin/
invoke_tests "Common" "Go"

View File

@@ -1,8 +1,9 @@
#!/bin/bash -e -o pipefail #!/bin/bash -e -o pipefail
source ~/utils/utils.sh source ~/utils/utils.sh
DEFAULT_RUBY_VERSION=$(get_toolset_value '.ruby.default')
echo Installing Ruby... echo Installing Ruby...
brew_smart_install "ruby@2.7" brew_smart_install "ruby@${DEFAULT_RUBY_VERSION}"
#if High Sierra - skip installation from toolset #if High Sierra - skip installation from toolset
if is_HighSierra; then if is_HighSierra; then

View File

@@ -4,7 +4,7 @@ source ~/utils/utils.sh
echo Updating RubyGems... echo Updating RubyGems...
gem update --system gem update --system
gemsToInstall=$(get_toolset_value ".rubygems[]") gemsToInstall=$(get_toolset_value '.ruby.rubygems | .[]')
if [ -n "$gemsToInstall" ]; then if [ -n "$gemsToInstall" ]; then
for gem in $gemsToInstall; do for gem in $gemsToInstall; do
echo "Installing gem $gem" echo "Installing gem $gem"

View File

@@ -159,6 +159,7 @@
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
"scripts": [ "scripts": [
"./provision/core/commonutils.sh", "./provision/core/commonutils.sh",
"./provision/core/golang.sh",
"./provision/core/openjdk.sh", "./provision/core/openjdk.sh",
"./provision/core/php.sh", "./provision/core/php.sh",
"./provision/core/aws.sh", "./provision/core/aws.sh",

View File

@@ -159,6 +159,7 @@
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
"scripts": [ "scripts": [
"./provision/core/commonutils.sh", "./provision/core/commonutils.sh",
"./provision/core/golang.sh",
"./provision/core/swiftlint.sh", "./provision/core/swiftlint.sh",
"./provision/core/openjdk.sh", "./provision/core/openjdk.sh",
"./provision/core/php.sh", "./provision/core/php.sh",

View File

@@ -160,6 +160,7 @@
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
"scripts": [ "scripts": [
"./provision/core/commonutils.sh", "./provision/core/commonutils.sh",
"./provision/core/golang.sh",
"./provision/core/swiftlint.sh", "./provision/core/swiftlint.sh",
"./provision/core/openjdk.sh", "./provision/core/openjdk.sh",
"./provision/core/php.sh", "./provision/core/php.sh",

View File

@@ -165,6 +165,7 @@
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
"scripts": [ "scripts": [
"./provision/core/commonutils.sh", "./provision/core/commonutils.sh",
"./provision/core/golang.sh",
"./provision/core/swiftlint.sh", "./provision/core/swiftlint.sh",
"./provision/core/openjdk.sh", "./provision/core/openjdk.sh",
"./provision/core/php.sh", "./provision/core/php.sh",

View File

@@ -24,11 +24,6 @@ Describe "SwiftFormat" {
} }
} }
Describe "Go" {
It "Go" {
"go version" | Should -ReturnZeroExitCode
}
}
Describe "GnuPG" { Describe "GnuPG" {
It "GnuPG" { It "GnuPG" {

View File

@@ -98,3 +98,9 @@ Describe "Bicep" {
"bicep --version" | Should -ReturnZeroExitCode "bicep --version" | Should -ReturnZeroExitCode
} }
} }
Describe "Go" {
It "Go" {
"go version" | Should -ReturnZeroExitCode
}
}

View File

@@ -1,5 +1,5 @@
Describe "RubyGems" { Describe "RubyGems" {
$gemTestCases = Get-ToolsetValue -KeyPath "rubygems" | ForEach-Object { $gemTestCases = Get-ToolsetValue -KeyPath "ruby.rubygems" | ForEach-Object {
@{gemName = $_} @{gemName = $_}
} }

View File

@@ -229,7 +229,6 @@
"gh", "gh",
"gnupg", "gnupg",
"gnu-tar", "gnu-tar",
"go@1.15",
"helm", "helm",
"libpq", "libpq",
"llvm", "llvm",
@@ -279,5 +278,19 @@
"versions": [ "versions": [
"2.1" "2.1"
] ]
},
"ruby": {
"default": "2.7",
"rubygems": [
"xcode-install",
"cocoapods",
"nomad-cli",
"xcpretty",
"bundler",
"fastlane"
]
},
"go": {
"default": "1.15"
} }
} }

View File

@@ -250,7 +250,6 @@
"gh", "gh",
"gnupg", "gnupg",
"gnu-tar", "gnu-tar",
"go@1.15",
"helm", "helm",
"kotlin", "kotlin",
"libpq", "libpq",
@@ -350,6 +349,8 @@
"2.1" "2.1"
] ]
}, },
"ruby": {
"default": "2.7",
"rubygems": [ "rubygems": [
"xcode-install", "xcode-install",
"cocoapods", "cocoapods",
@@ -358,4 +359,8 @@
"bundler", "bundler",
"fastlane" "fastlane"
] ]
},
"go": {
"default": "1.15"
}
} }

View File

@@ -201,7 +201,6 @@
"gh", "gh",
"gnupg", "gnupg",
"gnu-tar", "gnu-tar",
"go@1.15",
"helm", "helm",
"kotlin", "kotlin",
"libpq", "libpq",
@@ -304,6 +303,8 @@
"5.0" "5.0"
] ]
}, },
"ruby": {
"default": "2.7",
"rubygems": [ "rubygems": [
"xcode-install", "xcode-install",
"cocoapods", "cocoapods",
@@ -312,4 +313,8 @@
"bundler", "bundler",
"fastlane" "fastlane"
] ]
},
"go": {
"default": "1.15"
}
} }

View File

@@ -147,7 +147,6 @@
"gh", "gh",
"gnupg", "gnupg",
"gnu-tar", "gnu-tar",
"go@1.15",
"helm", "helm",
"kotlin", "kotlin",
"libpq", "libpq",
@@ -239,6 +238,8 @@
"5.0" "5.0"
] ]
}, },
"ruby": {
"default": "2.7",
"rubygems": [ "rubygems": [
"xcode-install", "xcode-install",
"cocoapods", "cocoapods",
@@ -247,4 +248,8 @@
"bundler", "bundler",
"fastlane" "fastlane"
] ]
},
"go": {
"default": "1.15"
}
} }