From 8c66e96beaf15a528d9db11a9762332cc9210cdf Mon Sep 17 00:00:00 2001 From: ilia-shipitsin <125650415+ilia-shipitsin@users.noreply.github.com> Date: Fri, 20 Oct 2023 08:50:55 +0200 Subject: [PATCH] [macos] use brew_smart_install where appropriate (#8607) --- images/macos/provision/core/apache.sh | 4 +++- images/macos/provision/core/aws.sh | 2 +- images/macos/provision/core/azcopy.sh | 2 +- images/macos/provision/core/bicep.sh | 4 +++- images/macos/provision/core/homebrew.sh | 4 ++-- images/macos/provision/core/nginx.sh | 4 +++- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/images/macos/provision/core/apache.sh b/images/macos/provision/core/apache.sh index 08639cba..8fa375f9 100644 --- a/images/macos/provision/core/apache.sh +++ b/images/macos/provision/core/apache.sh @@ -1,6 +1,8 @@ #!/bin/bash -e -o pipefail -brew install httpd +source ~/utils/utils.sh + +brew_smart_install httpd sudo sed -Ei '' 's/Listen .*/Listen 80/' $(brew --prefix)/etc/httpd/httpd.conf invoke_tests "WebServers" "Apache" diff --git a/images/macos/provision/core/aws.sh b/images/macos/provision/core/aws.sh index 8c05a16c..8b93dae5 100644 --- a/images/macos/provision/core/aws.sh +++ b/images/macos/provision/core/aws.sh @@ -8,7 +8,7 @@ sudo installer -pkg /tmp/AWSCLIV2.pkg -target / echo Installing aws sam cli... brew tap aws/tap -brew install aws-sam-cli +brew_smart_install aws-sam-cli echo "Install aws cli session manager" brew install --cask session-manager-plugin diff --git a/images/macos/provision/core/azcopy.sh b/images/macos/provision/core/azcopy.sh index cc188c73..5d540a7d 100755 --- a/images/macos/provision/core/azcopy.sh +++ b/images/macos/provision/core/azcopy.sh @@ -4,7 +4,7 @@ arch=$(get_arch) # Check MacOS architecture and if ARM install using brew if [ $arch == "arm64" ]; then - brew install azcopy + brew_smart_install azcopy else AZCOPY_DOWNLOAD_URL="https://aka.ms/downloadazcopy-v10-mac" diff --git a/images/macos/provision/core/bicep.sh b/images/macos/provision/core/bicep.sh index a2e7b584..87ca8ee9 100644 --- a/images/macos/provision/core/bicep.sh +++ b/images/macos/provision/core/bicep.sh @@ -1,7 +1,9 @@ #!/bin/bash -e -o pipefail +source ~/utils/utils.sh + echo Installing bicep cli... brew tap azure/bicep -brew install bicep +brew_smart_install bicep invoke_tests "Common" "Bicep" diff --git a/images/macos/provision/core/homebrew.sh b/images/macos/provision/core/homebrew.sh index 4e5b6379..e68db37b 100755 --- a/images/macos/provision/core/homebrew.sh +++ b/images/macos/provision/core/homebrew.sh @@ -27,10 +27,10 @@ brew analytics off # jq is required for further installation scripts echo "Installing jq..." -brew install jq +brew_smart_install jq echo "Installing curl..." -brew install curl +brew_smart_install curl echo "Installing wget..." brew_smart_install "wget" diff --git a/images/macos/provision/core/nginx.sh b/images/macos/provision/core/nginx.sh index 616c19ee..f9c1e4c7 100644 --- a/images/macos/provision/core/nginx.sh +++ b/images/macos/provision/core/nginx.sh @@ -1,6 +1,8 @@ #!/bin/bash -e -o pipefail -brew install nginx +source ~/utils/utils.sh + +brew_smart_install nginx sudo sed -Ei '' 's/listen.*/listen 80;/' $(brew --prefix)/etc/nginx/nginx.conf invoke_tests "WebServers" "Nginx"