From f8b0e9240dc6f01007c9cc62e1cd2e9c07c3f3b8 Mon Sep 17 00:00:00 2001 From: Nicolas Cantu Date: Thu, 23 Apr 2026 02:53:15 +0200 Subject: [PATCH] deploy: source LeCoffre deploy-log-filename.sh for tee log path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Motivations:** Single source of truth with lecoffre_ng_test deploy/scripts_v2/_lib/deploy-log-filename.sh. **Correctives:** Source project_root/deploy/scripts_v2/_lib/deploy-log-filename.sh; return 1 if missing. **Page affectées:** deploy/lib/deploy-log.sh. --- deploy/lib/deploy-log.sh | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/deploy/lib/deploy-log.sh b/deploy/lib/deploy-log.sh index 325d06e..4802072 100644 --- a/deploy/lib/deploy-log.sh +++ b/deploy/lib/deploy-log.sh @@ -11,26 +11,19 @@ deploy_script_tee_log_if_requested() { if [[ -z "$log_to_dir" ]]; then return 0 fi + local _lecoffre_deploy_log_fn="${project_root}/deploy/scripts_v2/_lib/deploy-log-filename.sh" + if [[ ! -f "$_lecoffre_deploy_log_fn" ]]; then + echo "[deploy-log] missing shared helper (expected LeCoffre repo layout): ${_lecoffre_deploy_log_fn}" >&2 + return 1 + fi + # shellcheck source=/dev/null + source "$_lecoffre_deploy_log_fn" mkdir -p "${project_root}/${log_to_dir}" - local site_slug="${SITE_CODE:-${LECOFFRE_SITE_CODE:-${DEPLOY_SITE_CODE:-}}}" - if [[ "$site_slug" == "notary" ]]; then - site_slug="lecoffreio" - fi - local ts - ts="$(date +%Y%m%d_%H%M%S)" local log_file - if [[ -n "$deploy_env" ]]; then - if [[ -n "$site_slug" ]]; then - log_file="${project_root}/${log_to_dir}/deploy_${deploy_env}_${site_slug}_kogus_${ts}.log" - else - log_file="${project_root}/${log_to_dir}/deploy_${deploy_env}_${ts}.log" - fi - else - log_file="${project_root}/${log_to_dir}/deploy_${ts}.log" - fi + log_file="$(lecoffre_deploy_log_file_path_for_tee "$project_root" "$log_to_dir" "${deploy_env:-}")" { printf '%s\n' "=== LeCoffre deploy log ===" - printf '%s\n' "environment=${deploy_env:-} site=${site_slug:-} started_at=${DEPLOY_STARTED_AT:-} project_root=${project_root}" + lecoffre_deploy_log_tee_header_metadata_line "$project_root" "${deploy_env:-}" } >"$log_file" _IA_DEV_DEPLOY_LOG="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" if [[ -f "${_IA_DEV_DEPLOY_LOG}/lib/smart_ide_logs.sh" ]]; then