From 11acebac774b93f21c2b2e8131fb632ace52b821 Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen.haas@lakedrops.com> Date: Thu, 7 Mar 2024 17:42:09 +0100 Subject: [PATCH] docker/l3d#144 Only set PHP_VERSION from docker compose file if it hasn't been set by lakedrops config before --- run/scripts/run | 13 +++++++++++++ run/scripts/start | 11 ----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/run/scripts/run b/run/scripts/run index 93a7f8d..85d89f7 100755 --- a/run/scripts/run +++ b/run/scripts/run @@ -9,6 +9,19 @@ if [[ "$L3D_CONFIG" != "[]" ]]; then export PHP_VERSION=$V fi fi +if [[ "$L3D_COMPOSE" != "[]" ]]; then + V=$(yq .name $L3D_COMPOSE) + if [[ "$V" != "null" ]]; then + export COMPOSE_PROJECT_NAME=$V + fi + if [[ ! -n ${PHP_VERSION} ]]; then + V=$(yq .services.php.image $L3D_COMPOSE | cut -d':' -f 2) + if [[ "$V" != "null" ]]; then + export PHP_VERSION=$V + fi + fi + rm "$L3D_COMPOSE" +fi COMMAND=start if [[ -n "$1" ]]; then diff --git a/run/scripts/start b/run/scripts/start index d722df1..66768e8 100755 --- a/run/scripts/start +++ b/run/scripts/start @@ -1,17 +1,6 @@ #!/bin/bash function getConfig() { - if [[ "$L3D_COMPOSE" != "[]" ]]; then - V=$(yq .name $L3D_COMPOSE) - if [[ "$V" != "null" ]]; then - COMPOSE_PROJECT_NAME=$V - fi - V=$(yq .services.php.image $L3D_COMPOSE | cut -d':' -f 2) - if [[ "$V" != "null" ]]; then - PHP_VERSION=$V - fi - rm "$L3D_COMPOSE" - fi if [[ ! -n ${PHP_VERSION} ]]; then while true; do DEFAULT=8.2 -- GitLab