From 99e2a045a6d2d9d0740a19a7b0580775e5c0405f Mon Sep 17 00:00:00 2001 From: Christian Winther Date: Fri, 5 Jan 2024 00:11:20 +0000 Subject: [PATCH] more renaming for clarity --- .../shared/root/docker/entrypoint.d/04-defaults.envsh | 2 +- .../shared/root/docker/entrypoint.d/05-templating.sh | 2 +- .../docker/shared/root/docker/entrypoint.d/10-storage.sh | 2 +- .../root/docker/entrypoint.d/15-storage-permissions.sh | 2 +- .../docker/shared/root/docker/entrypoint.d/20-horizon.sh | 2 +- .../docker/shared/root/docker/entrypoint.d/30-cache.sh | 2 +- contrib/docker/shared/root/docker/entrypoint.sh | 4 ++-- contrib/docker/shared/root/docker/helpers.sh | 8 ++++---- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/contrib/docker/shared/root/docker/entrypoint.d/04-defaults.envsh b/contrib/docker/shared/root/docker/entrypoint.d/04-defaults.envsh index 3f1a77843..3507d94ee 100755 --- a/contrib/docker/shared/root/docker/entrypoint.d/04-defaults.envsh +++ b/contrib/docker/shared/root/docker/entrypoint.d/04-defaults.envsh @@ -8,7 +8,7 @@ # # We also don't need to source `helpers.sh` since it's already available -entrypoint-set-name "${BASH_SOURCE[0]}" +entrypoint-set-script-name "${BASH_SOURCE[0]}" load-config-files diff --git a/contrib/docker/shared/root/docker/entrypoint.d/05-templating.sh b/contrib/docker/shared/root/docker/entrypoint.d/05-templating.sh index 4e6060e43..618a2d406 100755 --- a/contrib/docker/shared/root/docker/entrypoint.d/05-templating.sh +++ b/contrib/docker/shared/root/docker/entrypoint.d/05-templating.sh @@ -1,7 +1,7 @@ #!/bin/bash source /docker/helpers.sh -entrypoint-set-name "$0" +entrypoint-set-script-name "$0" # Show [git diff] of templates being rendered (will help verify output) : ${ENTRYPOINT_SHOW_TEMPLATE_DIFF:=1} diff --git a/contrib/docker/shared/root/docker/entrypoint.d/10-storage.sh b/contrib/docker/shared/root/docker/entrypoint.d/10-storage.sh index add20b5d6..fc952ea3a 100755 --- a/contrib/docker/shared/root/docker/entrypoint.d/10-storage.sh +++ b/contrib/docker/shared/root/docker/entrypoint.d/10-storage.sh @@ -1,7 +1,7 @@ #!/bin/bash source /docker/helpers.sh -entrypoint-set-name "$0" +entrypoint-set-script-name "$0" # Copy the [storage/] skeleton files over the "real" [storage/] directory so assets are updated between versions run-as-runtime-user cp --recursive storage.skel/ storage/ diff --git a/contrib/docker/shared/root/docker/entrypoint.d/15-storage-permissions.sh b/contrib/docker/shared/root/docker/entrypoint.d/15-storage-permissions.sh index d5844d661..30a58c5a9 100755 --- a/contrib/docker/shared/root/docker/entrypoint.d/15-storage-permissions.sh +++ b/contrib/docker/shared/root/docker/entrypoint.d/15-storage-permissions.sh @@ -1,7 +1,7 @@ #!/bin/bash source /docker/helpers.sh -entrypoint-set-name "$0" +entrypoint-set-script-name "$0" # Optionally fix ownership of configured paths : ${ENTRYPOINT_ENSURE_OWNERSHIP_PATHS:=""} diff --git a/contrib/docker/shared/root/docker/entrypoint.d/20-horizon.sh b/contrib/docker/shared/root/docker/entrypoint.d/20-horizon.sh index 2d3394746..6b81e7133 100755 --- a/contrib/docker/shared/root/docker/entrypoint.d/20-horizon.sh +++ b/contrib/docker/shared/root/docker/entrypoint.d/20-horizon.sh @@ -1,6 +1,6 @@ #!/bin/bash source /docker/helpers.sh -entrypoint-set-name "$0" +entrypoint-set-script-name "$0" run-as-runtime-user php artisan horizon:publish diff --git a/contrib/docker/shared/root/docker/entrypoint.d/30-cache.sh b/contrib/docker/shared/root/docker/entrypoint.d/30-cache.sh index 5c0f20bb8..e933a179b 100755 --- a/contrib/docker/shared/root/docker/entrypoint.d/30-cache.sh +++ b/contrib/docker/shared/root/docker/entrypoint.d/30-cache.sh @@ -1,7 +1,7 @@ #!/bin/bash source /docker/helpers.sh -entrypoint-set-name "$0" +entrypoint-set-script-name "$0" run-as-runtime-user php artisan route:cache run-as-runtime-user php artisan view:cache diff --git a/contrib/docker/shared/root/docker/entrypoint.sh b/contrib/docker/shared/root/docker/entrypoint.sh index e17a1c42b..173e4dbe3 100755 --- a/contrib/docker/shared/root/docker/entrypoint.sh +++ b/contrib/docker/shared/root/docker/entrypoint.sh @@ -15,7 +15,7 @@ export ENTRYPOINT_ROOT source /docker/helpers.sh # Set the entrypoint name for logging -entrypoint-set-name "entrypoint.sh" +entrypoint-set-script-name "entrypoint.sh" # Convert ENTRYPOINT_SKIP_SCRIPTS into a native bash array for easier lookup declare -a skip_scripts @@ -58,7 +58,7 @@ find "${ENTRYPOINT_ROOT}" -follow -type f -print | sort -V | while read -r file; # the sourced file will (should) than the log prefix, so this restores our own # "global" log prefix once the file is done being sourced - entrypoint-restore-name + entrypoint-restore-script-name ;; *.sh) diff --git a/contrib/docker/shared/root/docker/helpers.sh b/contrib/docker/shared/root/docker/helpers.sh index d80dc0d24..880027cf4 100644 --- a/contrib/docker/shared/root/docker/helpers.sh +++ b/contrib/docker/shared/root/docker/helpers.sh @@ -21,15 +21,15 @@ declare -ra dot_env_files=( # environment keys seen when source dot files (so we can [export] them) declare -ga seen_dot_env_variables=() -# @description Restore the log prefix to the previous value that was captured in [entrypoint-set-name] +# @description Restore the log prefix to the previous value that was captured in [entrypoint-set-script-name ] # @arg $1 string The name (or path) of the entrypoint script being run -function entrypoint-set-name() { +function entrypoint-set-script-name() { log_prefix_previous="${log_prefix}" log_prefix="ENTRYPOINT - [$(get-entrypoint-script-name $1)] - " } -# @description Restore the log prefix to the previous value that was captured in [entrypoint-set-name] -function entrypoint-restore-name() { +# @description Restore the log prefix to the previous value that was captured in [entrypoint-set-script-name ] +function entrypoint-restore-script-name() { log_prefix="${log_prefix_previous}" }