From 3cbec37106a788774137ae8ae3d2a6dcf984b942 Mon Sep 17 00:00:00 2001 From: Marcel <34819524+MarcelCoding@users.noreply.github.com> Date: Tue, 14 Nov 2023 23:40:54 +0100 Subject: [PATCH 1/4] Add crond log level environment variable (#1805) * Update docker-cron.sh Signed-off-by: Marcel <34819524+MarcelCoding@users.noreply.github.com> * Update stack.yml Signed-off-by: Marcel <34819524+MarcelCoding@users.noreply.github.com> * Update docker-cron.sh * Update docker-cron.sh Signed-off-by: Marcel <34819524+MarcelCoding@users.noreply.github.com> * Update stack.yml Signed-off-by: Marcel <34819524+MarcelCoding@users.noreply.github.com> --------- Signed-off-by: Marcel <34819524+MarcelCoding@users.noreply.github.com> --- docker-cron.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-cron.sh b/docker-cron.sh index 4dfa4118..b4cd9af6 100755 --- a/docker-cron.sh +++ b/docker-cron.sh @@ -1,4 +1,4 @@ #!/bin/sh set -eu -exec busybox crond -f -l 0 -L /dev/stdout +exec busybox crond -f -L /dev/stdout From 2bfad535438ec74046e86def0d737a967c45ce1a Mon Sep 17 00:00:00 2001 From: GitHub Workflow Date: Tue, 14 Nov 2023 22:41:10 +0000 Subject: [PATCH 2/4] Runs update.sh --- 25/apache/cron.sh | 2 +- 25/fpm-alpine/cron.sh | 2 +- 25/fpm/cron.sh | 2 +- 26/apache/cron.sh | 2 +- 26/fpm-alpine/cron.sh | 2 +- 26/fpm/cron.sh | 2 +- 27/apache/cron.sh | 2 +- 27/fpm-alpine/cron.sh | 2 +- 27/fpm/cron.sh | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/25/apache/cron.sh b/25/apache/cron.sh index 4dfa4118..b4cd9af6 100755 --- a/25/apache/cron.sh +++ b/25/apache/cron.sh @@ -1,4 +1,4 @@ #!/bin/sh set -eu -exec busybox crond -f -l 0 -L /dev/stdout +exec busybox crond -f -L /dev/stdout diff --git a/25/fpm-alpine/cron.sh b/25/fpm-alpine/cron.sh index 4dfa4118..b4cd9af6 100755 --- a/25/fpm-alpine/cron.sh +++ b/25/fpm-alpine/cron.sh @@ -1,4 +1,4 @@ #!/bin/sh set -eu -exec busybox crond -f -l 0 -L /dev/stdout +exec busybox crond -f -L /dev/stdout diff --git a/25/fpm/cron.sh b/25/fpm/cron.sh index 4dfa4118..b4cd9af6 100755 --- a/25/fpm/cron.sh +++ b/25/fpm/cron.sh @@ -1,4 +1,4 @@ #!/bin/sh set -eu -exec busybox crond -f -l 0 -L /dev/stdout +exec busybox crond -f -L /dev/stdout diff --git a/26/apache/cron.sh b/26/apache/cron.sh index 4dfa4118..b4cd9af6 100755 --- a/26/apache/cron.sh +++ b/26/apache/cron.sh @@ -1,4 +1,4 @@ #!/bin/sh set -eu -exec busybox crond -f -l 0 -L /dev/stdout +exec busybox crond -f -L /dev/stdout diff --git a/26/fpm-alpine/cron.sh b/26/fpm-alpine/cron.sh index 4dfa4118..b4cd9af6 100755 --- a/26/fpm-alpine/cron.sh +++ b/26/fpm-alpine/cron.sh @@ -1,4 +1,4 @@ #!/bin/sh set -eu -exec busybox crond -f -l 0 -L /dev/stdout +exec busybox crond -f -L /dev/stdout diff --git a/26/fpm/cron.sh b/26/fpm/cron.sh index 4dfa4118..b4cd9af6 100755 --- a/26/fpm/cron.sh +++ b/26/fpm/cron.sh @@ -1,4 +1,4 @@ #!/bin/sh set -eu -exec busybox crond -f -l 0 -L /dev/stdout +exec busybox crond -f -L /dev/stdout diff --git a/27/apache/cron.sh b/27/apache/cron.sh index 4dfa4118..b4cd9af6 100755 --- a/27/apache/cron.sh +++ b/27/apache/cron.sh @@ -1,4 +1,4 @@ #!/bin/sh set -eu -exec busybox crond -f -l 0 -L /dev/stdout +exec busybox crond -f -L /dev/stdout diff --git a/27/fpm-alpine/cron.sh b/27/fpm-alpine/cron.sh index 4dfa4118..b4cd9af6 100755 --- a/27/fpm-alpine/cron.sh +++ b/27/fpm-alpine/cron.sh @@ -1,4 +1,4 @@ #!/bin/sh set -eu -exec busybox crond -f -l 0 -L /dev/stdout +exec busybox crond -f -L /dev/stdout diff --git a/27/fpm/cron.sh b/27/fpm/cron.sh index 4dfa4118..b4cd9af6 100755 --- a/27/fpm/cron.sh +++ b/27/fpm/cron.sh @@ -1,4 +1,4 @@ #!/bin/sh set -eu -exec busybox crond -f -l 0 -L /dev/stdout +exec busybox crond -f -L /dev/stdout From 23d099bc33d5252e03d1ccb3b803f3c51beab9fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20V=C3=A6rum?= <6872940+dvaerum@users.noreply.github.com> Date: Wed, 15 Nov 2023 00:11:10 +0100 Subject: [PATCH 3/4] Bug fix: not found error if hook folder contains files but non ending with `*.sh` (#2095) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use `find` to located `*.sh` Signed-off-by: Dennis Vestergaard Værum * added msg if hook folder does not exist Signed-off-by: Dennis Vestergaard Værum * Updated info message Co-authored-by: J0WI Signed-off-by: Dennis Værum <6872940+dvaerum@users.noreply.github.com> * Update docker-entrypoint.sh Small adjustments Signed-off-by: Dennis Værum <6872940+dvaerum@users.noreply.github.com> --------- Signed-off-by: Dennis Vestergaard Værum Signed-off-by: Dennis Værum <6872940+dvaerum@users.noreply.github.com> Co-authored-by: J0WI --- docker-entrypoint.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 4c85f6ad..edb539a0 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -24,17 +24,17 @@ run_path() { local hook_folder_path="/docker-entrypoint-hooks.d/$1" local return_code=0 - echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" - - if [ -z "$(ls -A "${hook_folder_path}")" ]; then - echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do" + if ! [ -d "${hook_folder_path}" ]; then + echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist" return 0 fi + echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" + ( - for script_file_path in "${hook_folder_path}/"*.sh; do - if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then - echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag" + find "${hook_folder_path}" -type f -maxdepth 1 -iname '*.sh' -print | sort | while read -r script_file_path; do + if ! [ -x "${script_file_path}" ]; then + echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag" continue fi From cd0562ba8cda9f4afe814e406c6120e863001c91 Mon Sep 17 00:00:00 2001 From: GitHub Workflow Date: Tue, 14 Nov 2023 23:11:32 +0000 Subject: [PATCH 4/4] Runs update.sh --- 25/apache/entrypoint.sh | 14 +++++++------- 25/fpm-alpine/entrypoint.sh | 14 +++++++------- 25/fpm/entrypoint.sh | 14 +++++++------- 26/apache/entrypoint.sh | 14 +++++++------- 26/fpm-alpine/entrypoint.sh | 14 +++++++------- 26/fpm/entrypoint.sh | 14 +++++++------- 27/apache/entrypoint.sh | 14 +++++++------- 27/fpm-alpine/entrypoint.sh | 14 +++++++------- 27/fpm/entrypoint.sh | 14 +++++++------- 9 files changed, 63 insertions(+), 63 deletions(-) diff --git a/25/apache/entrypoint.sh b/25/apache/entrypoint.sh index 4c85f6ad..edb539a0 100755 --- a/25/apache/entrypoint.sh +++ b/25/apache/entrypoint.sh @@ -24,17 +24,17 @@ run_path() { local hook_folder_path="/docker-entrypoint-hooks.d/$1" local return_code=0 - echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" - - if [ -z "$(ls -A "${hook_folder_path}")" ]; then - echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do" + if ! [ -d "${hook_folder_path}" ]; then + echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist" return 0 fi + echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" + ( - for script_file_path in "${hook_folder_path}/"*.sh; do - if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then - echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag" + find "${hook_folder_path}" -type f -maxdepth 1 -iname '*.sh' -print | sort | while read -r script_file_path; do + if ! [ -x "${script_file_path}" ]; then + echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag" continue fi diff --git a/25/fpm-alpine/entrypoint.sh b/25/fpm-alpine/entrypoint.sh index 4c85f6ad..edb539a0 100755 --- a/25/fpm-alpine/entrypoint.sh +++ b/25/fpm-alpine/entrypoint.sh @@ -24,17 +24,17 @@ run_path() { local hook_folder_path="/docker-entrypoint-hooks.d/$1" local return_code=0 - echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" - - if [ -z "$(ls -A "${hook_folder_path}")" ]; then - echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do" + if ! [ -d "${hook_folder_path}" ]; then + echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist" return 0 fi + echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" + ( - for script_file_path in "${hook_folder_path}/"*.sh; do - if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then - echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag" + find "${hook_folder_path}" -type f -maxdepth 1 -iname '*.sh' -print | sort | while read -r script_file_path; do + if ! [ -x "${script_file_path}" ]; then + echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag" continue fi diff --git a/25/fpm/entrypoint.sh b/25/fpm/entrypoint.sh index 4c85f6ad..edb539a0 100755 --- a/25/fpm/entrypoint.sh +++ b/25/fpm/entrypoint.sh @@ -24,17 +24,17 @@ run_path() { local hook_folder_path="/docker-entrypoint-hooks.d/$1" local return_code=0 - echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" - - if [ -z "$(ls -A "${hook_folder_path}")" ]; then - echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do" + if ! [ -d "${hook_folder_path}" ]; then + echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist" return 0 fi + echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" + ( - for script_file_path in "${hook_folder_path}/"*.sh; do - if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then - echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag" + find "${hook_folder_path}" -type f -maxdepth 1 -iname '*.sh' -print | sort | while read -r script_file_path; do + if ! [ -x "${script_file_path}" ]; then + echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag" continue fi diff --git a/26/apache/entrypoint.sh b/26/apache/entrypoint.sh index 4c85f6ad..edb539a0 100755 --- a/26/apache/entrypoint.sh +++ b/26/apache/entrypoint.sh @@ -24,17 +24,17 @@ run_path() { local hook_folder_path="/docker-entrypoint-hooks.d/$1" local return_code=0 - echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" - - if [ -z "$(ls -A "${hook_folder_path}")" ]; then - echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do" + if ! [ -d "${hook_folder_path}" ]; then + echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist" return 0 fi + echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" + ( - for script_file_path in "${hook_folder_path}/"*.sh; do - if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then - echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag" + find "${hook_folder_path}" -type f -maxdepth 1 -iname '*.sh' -print | sort | while read -r script_file_path; do + if ! [ -x "${script_file_path}" ]; then + echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag" continue fi diff --git a/26/fpm-alpine/entrypoint.sh b/26/fpm-alpine/entrypoint.sh index 4c85f6ad..edb539a0 100755 --- a/26/fpm-alpine/entrypoint.sh +++ b/26/fpm-alpine/entrypoint.sh @@ -24,17 +24,17 @@ run_path() { local hook_folder_path="/docker-entrypoint-hooks.d/$1" local return_code=0 - echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" - - if [ -z "$(ls -A "${hook_folder_path}")" ]; then - echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do" + if ! [ -d "${hook_folder_path}" ]; then + echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist" return 0 fi + echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" + ( - for script_file_path in "${hook_folder_path}/"*.sh; do - if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then - echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag" + find "${hook_folder_path}" -type f -maxdepth 1 -iname '*.sh' -print | sort | while read -r script_file_path; do + if ! [ -x "${script_file_path}" ]; then + echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag" continue fi diff --git a/26/fpm/entrypoint.sh b/26/fpm/entrypoint.sh index 4c85f6ad..edb539a0 100755 --- a/26/fpm/entrypoint.sh +++ b/26/fpm/entrypoint.sh @@ -24,17 +24,17 @@ run_path() { local hook_folder_path="/docker-entrypoint-hooks.d/$1" local return_code=0 - echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" - - if [ -z "$(ls -A "${hook_folder_path}")" ]; then - echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do" + if ! [ -d "${hook_folder_path}" ]; then + echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist" return 0 fi + echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" + ( - for script_file_path in "${hook_folder_path}/"*.sh; do - if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then - echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag" + find "${hook_folder_path}" -type f -maxdepth 1 -iname '*.sh' -print | sort | while read -r script_file_path; do + if ! [ -x "${script_file_path}" ]; then + echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag" continue fi diff --git a/27/apache/entrypoint.sh b/27/apache/entrypoint.sh index 4c85f6ad..edb539a0 100755 --- a/27/apache/entrypoint.sh +++ b/27/apache/entrypoint.sh @@ -24,17 +24,17 @@ run_path() { local hook_folder_path="/docker-entrypoint-hooks.d/$1" local return_code=0 - echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" - - if [ -z "$(ls -A "${hook_folder_path}")" ]; then - echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do" + if ! [ -d "${hook_folder_path}" ]; then + echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist" return 0 fi + echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" + ( - for script_file_path in "${hook_folder_path}/"*.sh; do - if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then - echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag" + find "${hook_folder_path}" -type f -maxdepth 1 -iname '*.sh' -print | sort | while read -r script_file_path; do + if ! [ -x "${script_file_path}" ]; then + echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag" continue fi diff --git a/27/fpm-alpine/entrypoint.sh b/27/fpm-alpine/entrypoint.sh index 4c85f6ad..edb539a0 100755 --- a/27/fpm-alpine/entrypoint.sh +++ b/27/fpm-alpine/entrypoint.sh @@ -24,17 +24,17 @@ run_path() { local hook_folder_path="/docker-entrypoint-hooks.d/$1" local return_code=0 - echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" - - if [ -z "$(ls -A "${hook_folder_path}")" ]; then - echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do" + if ! [ -d "${hook_folder_path}" ]; then + echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist" return 0 fi + echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" + ( - for script_file_path in "${hook_folder_path}/"*.sh; do - if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then - echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag" + find "${hook_folder_path}" -type f -maxdepth 1 -iname '*.sh' -print | sort | while read -r script_file_path; do + if ! [ -x "${script_file_path}" ]; then + echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag" continue fi diff --git a/27/fpm/entrypoint.sh b/27/fpm/entrypoint.sh index 4c85f6ad..edb539a0 100755 --- a/27/fpm/entrypoint.sh +++ b/27/fpm/entrypoint.sh @@ -24,17 +24,17 @@ run_path() { local hook_folder_path="/docker-entrypoint-hooks.d/$1" local return_code=0 - echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" - - if [ -z "$(ls -A "${hook_folder_path}")" ]; then - echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do" + if ! [ -d "${hook_folder_path}" ]; then + echo "=> Skipping the folder \"${hook_folder_path}\", because it doesn't exist" return 0 fi + echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}" + ( - for script_file_path in "${hook_folder_path}/"*.sh; do - if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then - echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag" + find "${hook_folder_path}" -type f -maxdepth 1 -iname '*.sh' -print | sort | while read -r script_file_path; do + if ! [ -x "${script_file_path}" ]; then + echo "==> The script \"${script_file_path}\" was skipped, because it didn't have the executable flag" continue fi