diff --git a/images/macos/provision/core/commonutils.sh b/images/macos/provision/core/commonutils.sh index 0ff45595e..ff14e1239 100644 --- a/images/macos/provision/core/commonutils.sh +++ b/images/macos/provision/core/commonutils.sh @@ -56,9 +56,5 @@ for package in ${bcask_common_utils[@]}; do brew cask install $package done -if ! is_HighSierra; then - brew install swiftlint -fi - # Invoke bazel to download the latest bazel version via bazelisk bazel diff --git a/images/macos/provision/core/swiftlint.sh b/images/macos/provision/core/swiftlint.sh new file mode 100644 index 000000000..c9018cbb4 --- /dev/null +++ b/images/macos/provision/core/swiftlint.sh @@ -0,0 +1,9 @@ +#!/bin/bash -e -o pipefail + +source ~/utils/utils.sh + +echo "Install SwiftLint" +swiftlintUrl=$(curl -s "https://api.github.com/repos/realm/SwiftLint/releases/latest" | jq -r '.assets[].browser_download_url | select(contains("SwiftLint.pkg"))') +download_with_retries $swiftlintUrl "/tmp" "SwiftLint.pkg" +sudo installer -pkg /tmp/SwiftLint.pkg -target / +rm -rf /tmp/SwiftLint.pkg diff --git a/images/macos/templates/macOS-10.13.json b/images/macos/templates/macOS-10.13.json index e77ae1237..202e55bfe 100644 --- a/images/macos/templates/macOS-10.13.json +++ b/images/macos/templates/macOS-10.13.json @@ -126,9 +126,9 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", "pause_before": "30s", "scripts": [ + "./provision/core/xcode-clt.sh", "./provision/core/homebrew.sh", "./provision/core/powershell.sh", - "./provision/core/xcode-clt.sh", "./provision/core/dotnet.sh", "./provision/core/python.sh", "./provision/core/azcopy.sh", diff --git a/images/macos/templates/macOS-10.14.json b/images/macos/templates/macOS-10.14.json index 9e4139a20..628b47745 100644 --- a/images/macos/templates/macOS-10.14.json +++ b/images/macos/templates/macOS-10.14.json @@ -126,9 +126,9 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", "pause_before": "30s", "scripts": [ + "./provision/core/xcode-clt.sh", "./provision/core/homebrew.sh", "./provision/core/powershell.sh", - "./provision/core/xcode-clt.sh", "./provision/core/dotnet.sh", "./provision/core/python.sh", "./provision/core/azcopy.sh", @@ -159,6 +159,7 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", "scripts": [ "./provision/core/commonutils.sh", + "./provision/core/swiftlint.sh", "./provision/core/openjdk.sh", "./provision/core/php.sh", "./provision/core/aws.sh", diff --git a/images/macos/templates/macOS-10.15.json b/images/macos/templates/macOS-10.15.json index 43fbc76aa..8dae77cab 100644 --- a/images/macos/templates/macOS-10.15.json +++ b/images/macos/templates/macOS-10.15.json @@ -127,9 +127,9 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", "pause_before": "30s", "scripts": [ + "./provision/core/xcode-clt.sh", "./provision/core/homebrew.sh", "./provision/core/powershell.sh", - "./provision/core/xcode-clt.sh", "./provision/core/dotnet.sh", "./provision/core/python.sh", "./provision/core/azcopy.sh", @@ -160,6 +160,7 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", "scripts": [ "./provision/core/commonutils.sh", + "./provision/core/swiftlint.sh", "./provision/core/openjdk.sh", "./provision/core/php.sh", "./provision/core/aws.sh", diff --git a/images/macos/templates/macOS-11.0.json b/images/macos/templates/macOS-11.0.json index b1c3006b8..c3d898c0d 100644 --- a/images/macos/templates/macOS-11.0.json +++ b/images/macos/templates/macOS-11.0.json @@ -127,9 +127,9 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", "pause_before": "30s", "scripts": [ + "./provision/core/xcode-clt.sh", "./provision/core/homebrew.sh", "./provision/core/powershell.sh", - "./provision/core/xcode-clt.sh", "./provision/core/dotnet.sh", "./provision/core/python.sh", "./provision/core/azcopy.sh", @@ -160,6 +160,7 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", "scripts": [ "./provision/core/commonutils.sh", + "./provision/core/swiftlint.sh", "./provision/core/openjdk.sh", "./provision/core/php.sh", "./provision/core/aws.sh",