matrix : BUGFIX attendre la DB pour lancer synapse

This commit is contained in:
Gitouche 2022-01-29 11:37:34 +01:00
parent cce69e157d
commit 7571f5c8c1

View file

@ -28,10 +28,13 @@ podman run -d --name ${db_container_name} --pod ${pod_name} \
-e POSTGRES_DB=${container_name} \ -e POSTGRES_DB=${container_name} \
-e POSTGRES_INITDB_ARGS="--encoding=UTF8 --locale=C" \ -e POSTGRES_INITDB_ARGS="--encoding=UTF8 --locale=C" \
${postgres_image}:${postgres_version} && \ ${postgres_image}:${postgres_version} && \
echo -n "Waiting for PostgreSQL to be ready... " && \
( podman logs -f synapse-db 2>&1 & ) | grep -q 'database system is ready to accept connections' && \
echo "OK." && \
podman run -d --name ${container_name} --pod ${pod_name} \ podman run -d --name ${container_name} --pod ${pod_name} \
--mount type=volume,src=${confvolume},dst=/data ${synapse_image}:${synapse_version} --mount type=volume,src=${confvolume},dst=/data ${synapse_image}:${synapse_version} && \
echo -n "Waiting for background tasks to end... " && \
echo "Waiting for background tasks to end..." ( podman logs -f synapse 2>&1 & ) | grep -q 'No more background updates to do' && \
( podman logs -f synapse synapse-db 2>&1 & ) | grep -q 'No more background updates to do' && \ echo "OK." && \
podman pod stop ${pod_name} && \ podman pod stop ${pod_name} && \
echo "Done. Pod built and stopped." echo "Done. Pod built and stopped."