From 93d7fcac082ea7f99f2499be9aa146c04d7e4da0 Mon Sep 17 00:00:00 2001 From: Italo Date: Thu, 11 Jul 2024 22:14:37 -0400 Subject: [PATCH 1/2] Adds storage directories recreation --- .../etc/entrypoint.d/50-laravel-automations.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/common/etc/entrypoint.d/50-laravel-automations.sh b/src/common/etc/entrypoint.d/50-laravel-automations.sh index e4358e6ab..ceed9c999 100644 --- a/src/common/etc/entrypoint.d/50-laravel-automations.sh +++ b/src/common/etc/entrypoint.d/50-laravel-automations.sh @@ -41,6 +41,21 @@ if [ "$DISABLE_DEFAULT_CONFIG" = "false" ]; then # Check to see if an Artisan file exists and assume it means Laravel is configured. if [ -f "$APP_BASE_DIR/artisan" ] && [ "$AUTORUN_ENABLED" = "true" ]; then echo "Checking for Laravel automations..." + + ############################################################################ + # recreate storage + ############################################################################ + if [ "${AUTORUN_LARAVEL_STORAGE:=true}" = "true" ]; then + + storage_paths='storage storage/app/public storage/framework/cache/data storage/framework/sessions storage/framework/testings storage/framework/views storage/logs' + + for path in ${storage_paths}; do + if [ ! -d "$path" ]; then + mkdir -p "$path" + echo "✅ Rereated [$path] directory." + fi + done + ############################################################################ # artisan migrate ############################################################################ From bffd824c5853486946da58cb70b291b1a35a1f06 Mon Sep 17 00:00:00 2001 From: Italo Date: Thu, 11 Jul 2024 22:18:34 -0400 Subject: [PATCH 2/2] Update 50-laravel-automations.sh --- src/common/etc/entrypoint.d/50-laravel-automations.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/etc/entrypoint.d/50-laravel-automations.sh b/src/common/etc/entrypoint.d/50-laravel-automations.sh index ceed9c999..4fdfcacea 100644 --- a/src/common/etc/entrypoint.d/50-laravel-automations.sh +++ b/src/common/etc/entrypoint.d/50-laravel-automations.sh @@ -45,14 +45,14 @@ if [ "$DISABLE_DEFAULT_CONFIG" = "false" ]; then ############################################################################ # recreate storage ############################################################################ - if [ "${AUTORUN_LARAVEL_STORAGE:=true}" = "true" ]; then + if [ "${AUTORUN_LARAVEL_STORAGE_RECREATE:=true}" = "true" ]; then - storage_paths='storage storage/app/public storage/framework/cache/data storage/framework/sessions storage/framework/testings storage/framework/views storage/logs' + storage_paths='storage/app/public storage/framework/cache/data storage/framework/sessions storage/framework/testings storage/framework/views storage/logs' for path in ${storage_paths}; do if [ ! -d "$path" ]; then mkdir -p "$path" - echo "✅ Rereated [$path] directory." + echo "✅ Recreated [$path] directory." fi done