Merge branch 'main' into fix_sqlite-url
This commit is contained in:
@@ -16,23 +16,14 @@ function wait_for_postgres () {
|
||||
|
||||
function wait_for_mysql () {
|
||||
# Check if MySQL is up and accepting connections.
|
||||
HOSTNAME=$(python3 <<EOF
|
||||
try:
|
||||
from urllib.parse import urlparse
|
||||
except ImportError:
|
||||
from urlparse import urlparse
|
||||
o = urlparse('$DATABASE_URL')
|
||||
print(o.hostname)
|
||||
EOF
|
||||
)
|
||||
until mysqladmin ping --host "$HOSTNAME" --silent; do
|
||||
readarray -d' ' -t ENDPOINT <<< $(python3 -c "from urllib.parse import urlparse; o = urlparse('$DATABASE_URL'); print('%s %s' % (o.hostname, o.port if o.port else '3306'));")
|
||||
until mysqladmin ping --host ${ENDPOINT[0]} --port ${ENDPOINT[1]} --silent; do
|
||||
>&2 echo "MySQL is unavailable - sleeping"
|
||||
sleep 1
|
||||
done
|
||||
>&2 echo "MySQL is up - continuing"
|
||||
}
|
||||
|
||||
|
||||
function check_or_create () {
|
||||
# Check if the path exists, if not, create the directory.
|
||||
if [[ ! -e dir ]]; then
|
||||
|
||||
Reference in New Issue
Block a user