Files
runner-images/images/macos/provision/configuration/finalize-vm.sh
Mikhail Timofeev 0d46520ccf [macOS] Fail builds on errors during the image generation (#1756)
* set -e and fix all the scripts

* add source utils to finalize_vm script

* change xcode version in postbuild script

* fix for softwareupdates and for xcode version
2020-10-23 17:59:08 +03:00

24 lines
887 B
Bash

#!/bin/bash -e -o pipefail
source ~/utils/utils.sh
# Close all finder windows because they can interfere with UI tests
osascript -e 'tell application "Finder" to close windows'
if is_Less_BigSur; then
# Ignore available updates to prevent system pop-ups
updateName=$(softwareupdate -l | grep "Title: " | awk -F[:,] '{print $2}' | awk '{$1=$1};1') || true
if [ ! -z "$updateName" ]; then
sudo softwareupdate --ignore "$updateName"
fi
fi
# Put documentation to $HOME root
cp $HOME/image-generation/output/software-report/systeminfo.txt $HOME/image-generation/output/software-report/systeminfo.md $HOME/
# 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
# Clean up temporary directories
rm -rf ~/utils ~/image-generation