Files
runner-images/images/macos/scripts/build/finalize-vm.sh
T

44 lines
1.3 KiB
Bash
Raw Normal View History

#!/bin/bash -e -o pipefail
source ~/utils/utils.sh
2020-09-10 14:34:08 +03:00
# Close all finder windows because they can interfere with UI tests
2022-02-25 10:55:47 +03:00
close_finder_window
2020-09-10 14:34:08 +03:00
# Remove Parallels Desktop
# https://github.com/actions/runner-images/issues/6105
if is_Monterey; then
brew uninstall parallels
fi
2020-09-10 14:34:08 +03:00
# Put documentation to $HOME root
cp $HOME/image-generation/output/software-report/systeminfo.* $HOME/
2020-09-10 14:34:08 +03:00
2020-09-21 17:16:22 +03:00
# Put build vm assets scripts to proper directory
2020-10-27 18:36:59 +03:00
mkdir -p /usr/local/opt/$USER/scripts
2020-09-21 17:16:22 +03:00
mv $HOME/image-generation/assets/* /usr/local/opt/$USER/scripts
2020-09-23 14:13:02 +03:00
find /usr/local/opt/$USER/scripts -type f -name "*\.sh" -exec chmod +x {} \;
2020-09-23 13:30:07 +03:00
2022-09-09 16:58:47 +02:00
# Remove fastlane cached cookie
rm -rf ~/.fastlane
2020-09-10 14:34:08 +03:00
# Clean up npm cache which collected during image-generation
# we have to do that here because `npm install` is run in a few different places during image-generation
npm cache clean --force
2020-10-27 17:54:16 +03:00
# Clean yarn cache
2023-09-06 13:45:11 +02:00
yarn cache clean
2020-09-10 14:34:08 +03:00
# Clean up temporary directories
sudo rm -rf ~/utils /tmp/*
2020-10-21 16:09:53 +03:00
# Erase all indexes and wait until the rebuilding process ends,
# for now there is no way to get status of indexing process, it takes around 3 minutes to accomplish
sudo mdutil -E /
2020-10-29 09:19:29 +03:00
sudo log stream | grep -q -E 'mds.*Released.*BackgroundTask' || true
echo "Indexing completed"
# delete symlink for tests running
sudo rm -f /usr/local/bin/invoke_tests