2021-05-26 19:54:40 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-01-09 11:56:04 +00:00
|
|
|
|
|
|
|
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
|
|
|
|
source ${ABSDIR}/../functions.sh
|
|
|
|
source ${ABSDIR}/vars.sh
|
|
|
|
|
|
|
|
ensure_pwd_is_scriptdir
|
|
|
|
ensure_not_root
|
|
|
|
|
2022-01-28 20:15:15 +00:00
|
|
|
ensure_pod_not_exists ${pod_name}
|
2022-01-09 11:56:04 +00:00
|
|
|
ensure_variables_are_defined "$envvars"
|
|
|
|
|
2022-01-28 13:20:49 +00:00
|
|
|
if ! podman volume exists ${dbvolume} ; then
|
2022-01-09 11:56:04 +00:00
|
|
|
echo "Error : conf volume ${dbvolume} does not exists. Consider running 05_freshinstall.sh if this is the first install."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
cat <<EOT >> .env
|
|
|
|
MYSQL_ROOT_PASSWORD=${GARBAYE_FRAMADATE_MYSQL_ROOT_PASSWORD}
|
|
|
|
MYSQL_PASSWORD=${GARBAYE_FRAMADATE_MYSQL_PASSWORD}
|
|
|
|
APP_NAME=${GARBAYE_FRAMADATE_APP_NAME}
|
|
|
|
DOMAIN=${GARBAYE_FRAMADATE_DOMAIN}
|
|
|
|
ADMIN_MAIL=${GARBAYE_FRAMADATE_ADMIN_MAIL}
|
|
|
|
ADMIN_PASSWORD=${GARBAYE_FRAMADATE_ADMIN_PASSWORD}
|
|
|
|
SMTP_SERVER=${GARBAYE_FRAMADATE_SMTP_SERVER}
|
|
|
|
|
|
|
|
EOT
|
|
|
|
|
2022-08-16 19:35:56 +00:00
|
|
|
export framadate_image
|
|
|
|
export framadate_version
|
2023-02-15 21:33:57 +00:00
|
|
|
export mysql_image
|
|
|
|
export mysql_version
|
2022-02-11 13:02:39 +00:00
|
|
|
export listen_if
|
|
|
|
export listen_port
|
|
|
|
|
2022-11-13 13:03:54 +00:00
|
|
|
if ! podman image exists ${framadate_image}:${framadate_version}; then
|
2023-04-21 11:53:55 +00:00
|
|
|
podman image pull ${framadate_image}:${framadate_version}
|
2022-11-13 13:03:54 +00:00
|
|
|
fi
|
2023-04-21 11:53:55 +00:00
|
|
|
podman image pull ${mysql_image}:${mysql_version} &&
|
2022-11-13 13:03:54 +00:00
|
|
|
|
2024-06-11 19:40:39 +00:00
|
|
|
python3.9 podman-compose --pod-args="--infra=true --infra-name=${project_name}_infra --share=" --podman-run-args "--requires=${project_name}_infra --env-file .env" up -d &&
|
2022-08-16 19:35:56 +00:00
|
|
|
echo -n "Waiting for initialization to end... " &&
|
2023-04-21 11:53:55 +00:00
|
|
|
( podman container logs -f framadate-app 2>&1 & ) | grep -q 'configured -- resuming normal operations' &&
|
2022-08-16 19:35:56 +00:00
|
|
|
echo "OK" &&
|
2022-02-12 17:39:16 +00:00
|
|
|
shred -u .env &&
|
2022-01-28 21:34:31 +00:00
|
|
|
podman pod stop ${pod_name}
|