diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index a85a6e4..01da720 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,4 +1,11 @@ ------------------------------------------------------------------------------------------------------------------------------------ +Rx3-Docker/Docker Tools V 1.3.3 - A. GIBERT - 2025/01/04 +------------------------------------------------------------------------------------------------------------------------------------ + +- Add DOCKER_TOOLS_EXEPTION_LOGS env variable support. + + + Rx3-Docker/Docker Tools V 1.3.2 - A. GIBERT - 2024/12/27 ------------------------------------------------------------------------------------------------------------------------------------ @@ -20,7 +27,7 @@ Rx3-Docker/Docker Tools V 1.3.0 - A. GIBERT - 2024/11/26 - Improve docker_service_add function, - Switch by default to splited volume mode, -- Add DOCKER_TOOLS_DEBUG, DOCKER_TOOLS_VOLUME & DOCKER_TOOLS_EXECPTION_LIBS env variable support. +- Add DOCKER_TOOLS_DEBUG, DOCKER_TOOLS_VOLUME & DOCKER_TOOLS_EXEPTION_LIBS env variable support. - Warning: API break! diff --git a/sbin/docker_mk_env b/sbin/docker_mk_env index 45ab982..cb71f80 100755 --- a/sbin/docker_mk_env +++ b/sbin/docker_mk_env @@ -11,7 +11,10 @@ # SPLITED: By service volume mode + No service suffix # # DOCKER_TOOLS_EXEPTION_LIBS="module_name:lib_dir_name ..." -# Example: postgres:pgsq +# Example: "postgres:pgsq httpd:/var/www/html" +# +# DOCKER_TOOLS_EXEPTION_LOGS="module_name:log_dir_name ..." +# Example: "postgres:web-server:httpd" # #------------------------------------------------------------------------------- @@ -81,6 +84,25 @@ function module_lib_name_get +#------------------------------------------------------------------------------- +function module_log_name_get +{ + module=$1 + + for tup in ${DOCKER_TOOLS_EXEPTION_LOGS} + do + if [[ "${module}" == "${tup/:*}" ]] + then + echo ${tup/*:} + return + fi + done + + echo "${module}" +} + + + #------------------------------------------------------------------------------- function docker_service_add { @@ -181,12 +203,24 @@ function docker_service_add else path_prefix="" fi - module_lib_path=${path_prefix}${module_lib_name} + + module_log_name="$( module_log_name_get "${module_name}")" + + if [[ "${module_log_name}" != /* ]] + then + path_prefix="/var/log/" + else + path_prefix="" + fi + + module_log_path=${path_prefix}${module_log_name} + + dynvar_export "${varible_prefix}_LIB_INT" "${module_lib_path}" - dynvar_export "${varible_prefix}_LIB_EXT" "$( psfix_cat "${volume_prefix}${module_lib_path}" "-" "${volume_suffix_ext}")" + dynvar_export "${varible_prefix}_LIB_EXT" "$( psfix_cat "${volume_prefix}${module_lib_path}" "-" "${volume_suffix_ext}")" # dynvar_export "${varible_prefix}_LIB_INT" "/var/lib/${module_lib_name}" @@ -198,10 +232,14 @@ function docker_service_add dynvar_export "${varible_prefix}_LOG_SV_INT" "/var/log/supervisor" dynvar_export "${varible_prefix}_LOG_SV_EXT" "$( psfix_cat "${volume_prefix}/var/log/supervisor" "-" "${volume_suffix_ext}")" - dynvar_export "${varible_prefix}_LOG_MAIN_INT" "/var/log/${module_name}" - dynvar_export "${varible_prefix}_LOG_MAIN_EXT" "$( psfix_cat "${volume_prefix}/var/log/${module_name}" "-" "${volume_suffix_ext}")" + dynvar_export "${varible_prefix}_LOG_MAIN_INT" "${module_log_path}" + dynvar_export "${varible_prefix}_LOG_MAIN_EXT" "$( psfix_cat "${volume_prefix}${module_log_path}" "-" "${volume_suffix_ext}")" + +# dynvar_export "${varible_prefix}_LOG_MAIN_INT" "/var/log/${module_name}" +# dynvar_export "${varible_prefix}_LOG_MAIN_EXT" "$( psfix_cat "${volume_prefix}/var/log/${module_name}" "-" "${volume_suffix_ext}")" + # Ports if [[ "${port_main_int}" != "-" ]]