From 2edbc75d93f320057079653179fcecd1e46fc19c Mon Sep 17 00:00:00 2001 From: Gitouche Date: Tue, 11 Jun 2024 21:51:25 +0200 Subject: [PATCH] fix podman-compose + python (1/x) --- functions.sh | 14 ++++++++++++++ podman-framadate/10_install.sh | 2 +- podman-gitea/10_install.sh | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/functions.sh b/functions.sh index 02d0237..f443ebe 100644 --- a/functions.sh +++ b/functions.sh @@ -350,3 +350,17 @@ oci_push_to_registry () { fi fi } + +my_podman_compose () { + podman_compose_path=$(which podman-compose) + + if [[ ! -z ${podman_compose_path} ]]; then + for py in python3.9 python3.6; do + ${py} ${podman_compose_path} --version 2>/dev/null 1>&2 + if [[ $? -eq 0 ]]; then + "${py} ${podman_compose_path} ${@}" + break + fi + done + fi +} diff --git a/podman-framadate/10_install.sh b/podman-framadate/10_install.sh index 51442ce..6ed5157 100755 --- a/podman-framadate/10_install.sh +++ b/podman-framadate/10_install.sh @@ -38,7 +38,7 @@ if ! podman image exists ${framadate_image}:${framadate_version}; then fi podman image pull ${mysql_image}:${mysql_version} && -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 && +my_podman_compose --pod-args="--infra=true --infra-name=${project_name}_infra --share=" --podman-run-args "--requires=${project_name}_infra --env-file .env" up -d && echo -n "Waiting for initialization to end... " && ( podman container logs -f framadate-app 2>&1 & ) | grep -q 'configured -- resuming normal operations' && echo "OK" && diff --git a/podman-gitea/10_install.sh b/podman-gitea/10_install.sh index 6903a18..9eb5c66 100755 --- a/podman-gitea/10_install.sh +++ b/podman-gitea/10_install.sh @@ -57,7 +57,7 @@ fi podman image pull ${postgres_image}:${postgres_version} && # force refresh of app.ini podman unshare rm -f `get_podman_volume_path ${datavolume}`/gitea/conf/app.ini -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 && +my_podman_compose --pod-args="--infra=true --infra-name=${project_name}_infra --share=" --podman-run-args "--requires=${project_name}_infra --env-file .env" up -d && echo -n "Waiting for gitea to finish starting " && ( podman container logs -f ${container_name} 2>&1 & ) | grep -q 'NewServer()' && echo "OK" &&