Migration matrix podman 4.1

This commit is contained in:
KsmoinO 2022-11-05 19:11:16 +01:00
parent 1c1dae3e5b
commit 2f931db831
2 changed files with 4 additions and 5 deletions

View file

@ -23,8 +23,8 @@ fi
podman image pull ${synapse_image}:${synapse_version} && podman image pull ${synapse_image}:${synapse_version} &&
podman image exists ${synapse_image}:${synapse_version} && podman image exists ${synapse_image}:${synapse_version} &&
podman pull ${postgres_image}:${postgres_version} && podman pull ${postgres_image}:${postgres_version} &&
podman pod create --publish ${listen_if}:${listen_port}:8008 --name ${pod_name} && podman pod create --publish ${listen_if}:${listen_port}:8008 --name ${pod_name} --infra=true --infra-name=${project_name}_infra --share='' &&
podman run -d --name ${db_container_name} --pod ${pod_name} \ podman run -d --name ${db_container_name} --pod ${pod_name} --requires=${project_name}_infra \
--mount type=volume,src=${dbvolume},dst=/var/lib/postgresql/data/ \ --mount type=volume,src=${dbvolume},dst=/var/lib/postgresql/data/ \
-e POSTGRES_PASSWORD=${GARBAYE_MATRIX_POSTGRES_PASSWORD} \ -e POSTGRES_PASSWORD=${GARBAYE_MATRIX_POSTGRES_PASSWORD} \
-e POSTGRES_USER=${container_name} \ -e POSTGRES_USER=${container_name} \
@ -34,8 +34,7 @@ podman run -d --name ${db_container_name} --pod ${pod_name} \
echo -n "Waiting for PostgreSQL to be ready... " && echo -n "Waiting for PostgreSQL to be ready... " &&
( podman logs -f synapse-db 2>&1 & ) | grep -q 'database system is ready to accept connections' && ( podman logs -f synapse-db 2>&1 & ) | grep -q 'database system is ready to accept connections' &&
echo "OK." && echo "OK." &&
podman run -d --name ${container_name} --pod ${pod_name} \ podman run -d --name ${container_name} --pod ${pod_name} --requires=${project_name}_infra \
--add-host ${db_container_name}:127.0.0.1 \
--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 -n "Waiting for background tasks to end... " &&
( podman logs -f synapse 2>&1 & ) | grep -q 'No more background updates to do' && ( podman logs -f synapse 2>&1 & ) | grep -q 'No more background updates to do' &&

View file

@ -13,7 +13,7 @@ GARBAYE_MATRIX_URL="${GARBAYE_MATRIX_URL:-https://matrix.garbaye.fr}"
envvars='GARBAYE_MATRIX_POSTGRES_PASSWORD GARBAYE_MATRIX_DOMAIN GARBAYE_MATRIX_URL' envvars='GARBAYE_MATRIX_POSTGRES_PASSWORD GARBAYE_MATRIX_DOMAIN GARBAYE_MATRIX_URL'
## internal vars : do not touch ## internal vars : do not touch
project_name=${PWD##*/} project_name=${PWD##*/}
pod_name="${project_name}" pod_name="pod_${project_name}"
service_name="pod-${pod_name}.service" service_name="pod-${pod_name}.service"
upstream_images="${synapse_image} ${postgres_image}" upstream_images="${synapse_image} ${postgres_image}"
confvolume='matrixdotorg_synapse-data' confvolume='matrixdotorg_synapse-data'