Fix CI system to work on both Python 2 and 3 (#225)
* Use old style middleware settings for Python 2. * Make entrypoint python2 and 3 compatible. * Fix python command to test for mysql server. * Bettery docker-entrypoint to work with Python 2 & 3 * Add missing braces.
This commit is contained in:
@@ -16,7 +16,15 @@ function wait_for_postgres () {
|
||||
|
||||
function wait_for_mysql () {
|
||||
# Check if MySQL is up and accepting connections.
|
||||
HOSTNAME=$(python -c "from urllib.parse import urlparse; o = urlparse('$DATABASE_URL'); print(o.hostname);")
|
||||
HOSTNAME=$(python <<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
|
||||
>&2 echo "MySQL is unavailable - sleeping"
|
||||
sleep 1
|
||||
|
||||
Reference in New Issue
Block a user