diff --git a/docker/scripts/configure-base-store.sh b/docker/scripts/configure-base-store.sh index 3a1ab10..86d4024 100755 --- a/docker/scripts/configure-base-store.sh +++ b/docker/scripts/configure-base-store.sh @@ -9,8 +9,15 @@ bin/magento config:set currency/options/default GBP bin/magento config:set general/locale/timezone Europe/London bin/magento config:set general/locale/code en_GB bin/magento config:set carriers/freeshipping/active 1 -bin/magento deploy:mode:set developer +if [ "$RVVUP_HYVA_CHECKOUT_VERSION" == "local" ]; then + bin/magento deploy:mode:set developer + # Disable opcache + sed -i 's/^opcache\.enable *= *1/opcache.enable = 0/' /opt/bitnami/php/etc/php.ini + sed -i 's/^opcache\.enable_cli *= *1/opcache.enable_cli = 0/' /opt/bitnami/php/etc/php.ini + composer config allow-plugins.wikimedia/composer-merge-plugin true + composer require wikimedia/composer-merge-plugin +fi echo "Configuring SMTP settings to point to $MAGENTO_SMTP_HOST:$MAGENTO_SMTP_PORT" bin/magento config:set system/smtp/disable 0 bin/magento config:set system/smtp/transport smtp @@ -19,9 +26,4 @@ bin/magento config:set system/smtp/port $MAGENTO_SMTP_PORT bin/magento sampledata:deploy -# Disable opcache -sed -i 's/^opcache\.enable *= *1/opcache.enable = 0/' /opt/bitnami/php/etc/php.ini -sed -i 's/^opcache\.enable_cli *= *1/opcache.enable_cli = 0/' /opt/bitnami/php/etc/php.ini - -composer config allow-plugins.wikimedia/composer-merge-plugin true -composer require n98/magerun2-dist wikimedia/composer-merge-plugin \ No newline at end of file +composer require n98/magerun2-dist wikimedia/composer-merge-plugin diff --git a/docker/scripts/fix-perms.sh b/docker/scripts/fix-perms.sh index 92ad319..654b569 100755 --- a/docker/scripts/fix-perms.sh +++ b/docker/scripts/fix-perms.sh @@ -3,4 +3,6 @@ mkdir -p var/cache mkdir -p var/log find var vendor pub/static pub/media app/etc generated var/log var/cache \( -type f -or -type d \) -exec chmod u+w {} +; chown -R daemon:daemon ./ -rm -rf var/cache/* var/generation/* var/page_cache/* var/view_preprocessed/* var/di/* pub/static/* generated/* +if [ "$RVVUP_HYVA_CHECKOUT_VERSION" == "local" ]; then + rm -rf var/cache/* var/generation/* var/page_cache/* var/view_preprocessed/* var/di/* pub/static/* generated/* +fi \ No newline at end of file diff --git a/docker/scripts/run-on-local-volume.sh b/docker/scripts/run-on-local-volume.sh index d77d079..d1a1059 100755 --- a/docker/scripts/run-on-local-volume.sh +++ b/docker/scripts/run-on-local-volume.sh @@ -6,4 +6,4 @@ jq '.extra."merge-plugin"."merge-dev" = false' composer.json > composer-temp.jso composer update -W /rvvup/scripts/rebuild-magento.sh bin/magento config:set payment/rvvup/jwt $RVVUP_API_KEY -bin/magento config:set payment/rvvup/active 1 \ No newline at end of file +bin/magento config:set payment/rvvup/active 1 diff --git a/docker/scripts/setup.sh b/docker/scripts/setup.sh index c9cd66c..f116a4e 100755 --- a/docker/scripts/setup.sh +++ b/docker/scripts/setup.sh @@ -4,12 +4,14 @@ echo "Running setup.sh" /rvvup/scripts/configure-rvvup.sh; /rvvup/scripts/post-magento-setup.sh; -cd /bitnami/magento -# Only run in first attempt, then reset -echo "echo \"Ignored running base store config\"" > /rvvup/scripts/configure-base-store.sh -echo "echo \"Ignored running hyva setup\"" > /rvvup/scripts/configure-hyva.sh -echo "echo \"Ignored running rvvup config\"" > /rvvup/scripts/configure-rvvup.sh -echo "/rvvup/scripts/run-on-local-volume.sh" > /rvvup/scripts/post-magento-setup.sh - +if [ "$RVVUP_HYVA_CHECKOUT_VERSION" == "local" ]; then + cd /bitnami/magento + # Only run in first attempt, then reset + echo "echo \"Ignored running base store config\"" > /rvvup/scripts/configure-base-store.sh + echo "echo \"Ignored running hyva setup\"" > /rvvup/scripts/configure-hyva.sh + echo "echo \"Ignored running rvvup config\"" > /rvvup/scripts/configure-rvvup.sh + sed -i '1s/^/RVVUP_HYVA_CHECKOUT_VERSION=local \n/' /rvvup/scripts/fix-perms.sh + echo "/rvvup/scripts/run-on-local-volume.sh" > /rvvup/scripts/post-magento-setup.sh +fi /rvvup/scripts/fix-perms.sh; /opt/bitnami/scripts/magento/run.sh;