mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
Merge pull request #10583 from coolbry95/waitfordb
wait for database connection
This commit is contained in:
@@ -13,6 +13,10 @@ if [ -n "${AWX_KUBE_DEVEL}" ]; then
|
|||||||
export SDB_NOTIFY_HOST=$MY_POD_IP
|
export SDB_NOTIFY_HOST=$MY_POD_IP
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
wait-for-migrations
|
||||||
|
|
||||||
awx-manage collectstatic --noinput --clear
|
awx-manage collectstatic --noinput --clear
|
||||||
|
|
||||||
supervisord -c /etc/supervisord.conf
|
supervisord -c /etc/supervisord.conf
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ if [ -n "${AWX_KUBE_DEVEL}" ]; then
|
|||||||
export SDB_NOTIFY_HOST=$MY_POD_IP
|
export SDB_NOTIFY_HOST=$MY_POD_IP
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
wait-for-migrations
|
wait-for-migrations
|
||||||
|
|
||||||
supervisord -c /etc/supervisord_task.conf
|
supervisord -c /etc/supervisord_task.conf
|
||||||
|
|||||||
@@ -22,13 +22,20 @@ wait_for() {
|
|||||||
local rc=1
|
local rc=1
|
||||||
local attempt=1
|
local attempt=1
|
||||||
local next_sleep="${MIN_SLEEP}"
|
local next_sleep="${MIN_SLEEP}"
|
||||||
|
local check=1
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
log_message "Attempt ${attempt} of ${ATTEMPTS}"
|
log_message "Attempt ${attempt} of ${ATTEMPTS}"
|
||||||
|
|
||||||
timeout "${TIMEOUT}" \
|
timeout "${TIMEOUT}" \
|
||||||
/bin/bash -c "! awx-manage showmigrations | grep '\[ \]'" &>/dev/null \
|
/bin/bash -c "awx-manage check" &>/dev/null
|
||||||
&& return || rc=$?
|
check=$?
|
||||||
|
|
||||||
|
if [ $check -eq 0 ]; then
|
||||||
|
timeout "${TIMEOUT}" \
|
||||||
|
/bin/bash -c "! awx-manage showmigrations | grep '\[ \]'" &>/dev/null \
|
||||||
|
&& return || rc=$?
|
||||||
|
fi
|
||||||
|
|
||||||
(( ++attempt > ATTEMPTS )) && break
|
(( ++attempt > ATTEMPTS )) && break
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user