From 24e79a4e0f0092690e54e6c239f2c3a4584a4cd8 Mon Sep 17 00:00:00 2001 From: Thibault Dethier Date: Thu, 12 Dec 2024 11:54:46 +0100 Subject: [PATCH] Added /var/app/log config --- .platform/hooks/postdeploy/01_log_create_directory.sh | 7 +++++++ .platform/hooks/postdeploy/02_log_change_permissions.sh | 7 +++++++ .../{01_compile_messages.sh => 05_compile_messages.sh} | 0 .../{02_collect_static.sh => 06_collect_static.sh} | 0 .../hooks/postdeploy/{03_migrate.sh => 07_migrate.sh} | 0 .../{04_create_cache_table.sh => 08_create_cache_table.sh} | 0 6 files changed, 14 insertions(+) create mode 100755 .platform/hooks/postdeploy/01_log_create_directory.sh create mode 100755 .platform/hooks/postdeploy/02_log_change_permissions.sh rename .platform/hooks/postdeploy/{01_compile_messages.sh => 05_compile_messages.sh} (100%) rename .platform/hooks/postdeploy/{02_collect_static.sh => 06_collect_static.sh} (100%) rename .platform/hooks/postdeploy/{03_migrate.sh => 07_migrate.sh} (100%) rename .platform/hooks/postdeploy/{04_create_cache_table.sh => 08_create_cache_table.sh} (100%) diff --git a/.platform/hooks/postdeploy/01_log_create_directory.sh b/.platform/hooks/postdeploy/01_log_create_directory.sh new file mode 100755 index 0000000000..6525dae464 --- /dev/null +++ b/.platform/hooks/postdeploy/01_log_create_directory.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Only run on the leader instance +if [ "$EB_IS_COMMAND_LEADER" == "true" ]; then + echo "Preparing a new directory for Django logs..." + docker exec -t $(docker ps -a -q | head -n 1) mkdir -p /var/app/log +fi \ No newline at end of file diff --git a/.platform/hooks/postdeploy/02_log_change_permissions.sh b/.platform/hooks/postdeploy/02_log_change_permissions.sh new file mode 100755 index 0000000000..978f4bade9 --- /dev/null +++ b/.platform/hooks/postdeploy/02_log_change_permissions.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Only run on the leader instance +if [ "$EB_IS_COMMAND_LEADER" == "true" ]; then + echo "Changing permissions on the Django logs directory..." + docker exec -t $(docker ps -a -q | head -n 1) chmod g+s /var/app/log +fi \ No newline at end of file diff --git a/.platform/hooks/postdeploy/01_compile_messages.sh b/.platform/hooks/postdeploy/05_compile_messages.sh similarity index 100% rename from .platform/hooks/postdeploy/01_compile_messages.sh rename to .platform/hooks/postdeploy/05_compile_messages.sh diff --git a/.platform/hooks/postdeploy/02_collect_static.sh b/.platform/hooks/postdeploy/06_collect_static.sh similarity index 100% rename from .platform/hooks/postdeploy/02_collect_static.sh rename to .platform/hooks/postdeploy/06_collect_static.sh diff --git a/.platform/hooks/postdeploy/03_migrate.sh b/.platform/hooks/postdeploy/07_migrate.sh similarity index 100% rename from .platform/hooks/postdeploy/03_migrate.sh rename to .platform/hooks/postdeploy/07_migrate.sh diff --git a/.platform/hooks/postdeploy/04_create_cache_table.sh b/.platform/hooks/postdeploy/08_create_cache_table.sh similarity index 100% rename from .platform/hooks/postdeploy/04_create_cache_table.sh rename to .platform/hooks/postdeploy/08_create_cache_table.sh