Skip to content

Commit 1b6f6d7

Browse files
Run magerun in magento1 images as app user
code owner was causing the log directory and files to be created as build user, when www-data needs write access
1 parent 5e75592 commit 1b6f6d7

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

magento1/usr/local/share/magento1/magento_functions.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,24 +64,24 @@ function do_replace_core_config_values() (
6464
)
6565

6666
function do_magento_config_cache_enable() {
67-
as_code_owner "php /app/bin/n98-magerun.phar cache:enable config" "${MAGE_ROOT}"
67+
as_app_user "php /app/bin/n98-magerun.phar cache:enable config" "${MAGE_ROOT}"
6868
}
6969

7070
function do_magento_config_cache_clean() {
71-
as_code_owner "php /app/bin/n98-magerun.phar cache:clean config" "${MAGE_ROOT}"
71+
as_app_user "php /app/bin/n98-magerun.phar cache:clean config" "${MAGE_ROOT}"
7272
}
7373

7474
function do_magento_system_setup() {
75-
as_code_owner "php /app/bin/n98-magerun.phar sys:setup:incremental -n" "${MAGE_ROOT}"
75+
as_app_user "php /app/bin/n98-magerun.phar sys:setup:incremental -n" "${MAGE_ROOT}"
7676
}
7777

7878
function do_magento_reindex() {
79-
(as_code_owner "php /app/bin/n98-magerun.phar index:reindex:all" "${MAGE_ROOT}" || echo "Failing indexing to the end, ignoring.") && echo "Indexing successful"
79+
(as_app_user "php /app/bin/n98-magerun.phar index:reindex:all" "${MAGE_ROOT}" || echo "Failing indexing to the end, ignoring.") && echo "Indexing successful"
8080
}
8181

8282
function do_magento_cache_flush() {
8383
# Flush magento cache
84-
as_code_owner "php bin/n98-magerun.phar cache:flush"
84+
as_app_user "php bin/n98-magerun.phar cache:flush"
8585
}
8686

8787
function do_magento_create_admin_user() (
@@ -91,13 +91,13 @@ function do_magento_create_admin_user() (
9191

9292
# Create magento admin user
9393
set +e
94-
as_code_owner "php /app/bin/n98-magerun.phar admin:user:list | grep -q '$MAGENTO_ADMIN_USERNAME'" "${MAGE_ROOT}"
94+
as_app_user "php /app/bin/n98-magerun.phar admin:user:list | grep -q '$MAGENTO_ADMIN_USERNAME'" "${MAGE_ROOT}"
9595
local HAS_ADMIN_USER=$?
9696
set -e
9797
if [ "$HAS_ADMIN_USER" != 0 ]; then
9898
set +x
9999
echo "Creating admin user '$MAGENTO_ADMIN_USERNAME'"
100-
as_code_owner "php /app/bin/n98-magerun.phar admin:user:create '$MAGENTO_ADMIN_USERNAME' '$MAGENTO_ADMIN_EMAIL' '$MAGENTO_ADMIN_PASSWORD' '$MAGENTO_ADMIN_FORENAME' '$MAGENTO_ADMIN_SURNAME' Administrators" "${MAGE_ROOT}"
100+
as_app_user "php /app/bin/n98-magerun.phar admin:user:create '$MAGENTO_ADMIN_USERNAME' '$MAGENTO_ADMIN_EMAIL' '$MAGENTO_ADMIN_PASSWORD' '$MAGENTO_ADMIN_FORENAME' '$MAGENTO_ADMIN_SURNAME' Administrators" "${MAGE_ROOT}"
101101
fi
102102
)
103103

0 commit comments

Comments
 (0)