mirror of
https://github.com/actions/runner-images.git
synced 2025-12-17 23:28:57 +00:00
[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
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/bash -e -o pipefail
|
||||
|
||||
#Install latest version of postgresql
|
||||
brew install postgres
|
||||
@@ -6,13 +6,21 @@ brew install postgres
|
||||
#Service postgresql should be started before use.
|
||||
brew services start postgresql
|
||||
|
||||
#Verify that PostgreSQL is ready for accept incoming connections.
|
||||
# exit codes:
|
||||
# ready - 0
|
||||
# reject - 1
|
||||
# connection timeout - 2
|
||||
# incorrect credentials or parameters - 3
|
||||
pg_isready
|
||||
#Verify PostgreSQL is ready for accept incoming connections
|
||||
echo "Check PostgreSQL service is running"
|
||||
i=10
|
||||
COMMAND='pg_isready'
|
||||
while [ $i -gt 0 ]; do
|
||||
echo "Check PostgreSQL service status"
|
||||
eval $COMMAND && break
|
||||
((i--))
|
||||
if [ $i == 0 ]; then
|
||||
echo "PostgreSQL service not ready, all attempts exhausted"
|
||||
exit 1
|
||||
fi
|
||||
echo "PostgreSQL service not ready, wait 10 more sec, attempts left: $i"
|
||||
sleep 10
|
||||
done
|
||||
|
||||
#Stop postgresql
|
||||
brew services stop postgresql
|
||||
Reference in New Issue
Block a user