[macOS] Refactor the rest of the scripts (#9113)

* [macOS] Refactor the rest of the scripts

* Return quotes to config tccdb script

* Return quotes to config tccdb script

* Revert some changes in ruby scripts

* Revert some changes in ruby scripts

* Revert some changes chrome script

* check errors

* check errors 01

* find errors in common-utils

* find errors in edge install

* find errors in edge install

---------

Co-authored-by: Alexey Ayupov <“alexey.ayupov@akvelon.com”>
This commit is contained in:
Alexey-Ayupov
2024-01-09 14:47:31 +01:00
committed by GitHub
parent 5bdda2e8c2
commit 5a6e215859
48 changed files with 203 additions and 264 deletions

View File

@@ -19,32 +19,32 @@ echo "Google Chrome version is $full_chrome_version"
# Get Google Chrome versions information
chrome_platform="mac-$arch"
CHROME_VERSIONS_URL="https://googlechromelabs.github.io/chrome-for-testing/latest-patch-versions-per-build-with-downloads.json"
chrome_versions_json="$(cat "$(download_with_retry "$CHROME_VERSIONS_URL")")"
chrome_versions_json="$(cat $(download_with_retry "$CHROME_VERSIONS_URL"))"
# Download and unpack the latest release of Chrome Driver
chromedriver_version=$(echo "${chrome_versions_json}" | jq -r '.builds["'"$chrome_version"'"].version')
chromedriver_version=$(echo $chrome_versions_json | jq -r '.builds["'"$chrome_version"'"].version')
echo "Installing Chrome Driver version $chromedriver_version"
chromedriver_url=$(echo "${chrome_versions_json}" | jq -r '.builds["'"$chrome_version"'"].downloads.chromedriver[] | select(.platform=="'"${chrome_platform}"'").url')
chromedriver_dir="/usr/local/share/chromedriver-${chrome_platform}"
chromedriver_url=$(echo $chrome_versions_json | jq -r '.builds["'"$chrome_version"'"].downloads.chromedriver[] | select(.platform=="'"${chrome_platform}"'").url')
chromedriver_dir="/usr/local/share/chromedriver-$chrome_platform"
chromedriver_bin="$chromedriver_dir/chromedriver"
chromedriver_archive_path=$(download_with_retry "$chromedriver_url")
unzip -qq "$chromedriver_archive_path" -d /tmp/
sudo mv "/tmp/chromedriver-${chrome_platform}" "$chromedriver_dir"
ln -s "$chromedriver_bin" /usr/local/bin/chromedriver
echo "export CHROMEWEBDRIVER=$chromedriver_dir" >> "${HOME}/.bashrc"
chromedriver_archive_path=$(download_with_retry $chromedriver_url)
unzip -qq $chromedriver_archive_path -d /tmp/
sudo mv /tmp/chromedriver-$chrome_platform $chromedriver_dir
ln -s $chromedriver_bin /usr/local/bin/chromedriver
echo "export CHROMEWEBDRIVER=$chromedriver_dir" >> ${HOME}/.bashrc
# Download and unpack the latest release of Google Chrome for Testing
chrome_for_testing_version=$(echo "${chrome_versions_json}" | jq -r '.builds["'"$chrome_version"'"].version')
chrome_for_testing_version=$(echo $chrome_versions_json | jq -r '.builds["'"$chrome_version"'"].version')
echo "Installing Google Chrome for Testing version $chrome_for_testing_version"
chrome_for_testing_url=$(echo "${chrome_versions_json}" | jq -r '.builds["'"$chrome_version"'"].downloads.chrome[] | select(.platform=="'"${chrome_platform}"'").url')
chrome_for_testing_url=$(echo $chrome_versions_json | jq -r '.builds["'"$chrome_version"'"].downloads.chrome[] | select(.platform=="'"${chrome_platform}"'").url')
chrome_for_testing_app="Google Chrome for Testing.app"
chrome_for_testing_archive_path=$(download_with_retry "$chrome_for_testing_url")
unzip -qq "$chrome_for_testing_archive_path" -d /tmp/
mv "/tmp/chrome-${chrome_platform}/${chrome_for_testing_app}" "/Applications/${chrome_for_testing_app}"
chrome_for_testing_archive_path=$(download_with_retry $chrome_for_testing_url)
unzip -qq $chrome_for_testing_archive_path -d /tmp/
mv "/tmp/chrome-$chrome_platform/$chrome_for_testing_app" "/Applications/$chrome_for_testing_app"
echo "Installing Selenium"
brew_smart_install "selenium-server"