2021-06-14 10:42:59 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
|
|
|
|
source ${ABSDIR}/../functions.sh
|
|
|
|
source ${ABSDIR}/vars.sh
|
|
|
|
|
|
|
|
ensure_pwd_is_scriptdir
|
|
|
|
ensure_not_root
|
|
|
|
|
2021-07-01 17:28:13 +00:00
|
|
|
ensure_variables_are_defined "$envvars"
|
|
|
|
|
2021-06-14 10:42:59 +00:00
|
|
|
if [[ ! -d ~/.local/share/containers/storage/volumes/${confvolume} ]]; then
|
|
|
|
echo "Error : conf volume ${confvolume} does not exists. Consider running 05_freshinstall.sh if this is the first install."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! -d ~/.local/share/containers/storage/volumes/${dbvolume} ]]; then
|
|
|
|
echo "Error : conf volume ${dbvolume} does not exists. Consider running 05_freshinstall.sh if this is the first install."
|
|
|
|
exit 1
|
|
|
|
fi
|
2021-07-04 19:21:54 +00:00
|
|
|
|
|
|
|
# FAIL if pod exists
|
|
|
|
ensure_pod_not_exists ${pod_name}
|
|
|
|
|
2021-06-14 10:42:59 +00:00
|
|
|
podman pod create --publish 8086:8008 --name ${pod_name} && \
|
|
|
|
podman run -d --name ${db_container_name} --pod ${pod_name} \
|
2021-06-14 16:46:29 +00:00
|
|
|
--mount type=volume,src=${dbvolume},dst=/var/lib/postgresql/data/ \
|
2021-07-01 17:28:13 +00:00
|
|
|
-e POSTGRES_PASSWORD=${GARBAYE_MATRIX_POSTGRES_PASSWORD} \
|
2021-06-14 10:42:59 +00:00
|
|
|
-e POSTGRES_USER=${container_name} \
|
|
|
|
-e POSTGRES_DB=${container_name} \
|
|
|
|
-e POSTGRES_INITDB_ARGS="--encoding=UTF8 --locale=C" \
|
2021-06-15 08:10:19 +00:00
|
|
|
${postgres_image}:${postgres_version} && \
|
2021-06-14 12:19:55 +00:00
|
|
|
podman run -d --name ${container_name} --pod ${pod_name} \
|
2021-06-15 08:10:19 +00:00
|
|
|
--mount type=volume,src=${confvolume},dst=/data ${synapse_image}:${synapse_version} && \
|
2021-06-14 13:10:05 +00:00
|
|
|
echo "Pod built and starting
|
|
|
|
run 'podman logs -f synapse synapse-db' to show initialisation status
|
|
|
|
then stop pod with 'podman pod stop ${pod_name}'"
|