Skip to content

Commit

Permalink
Run Local Setup only when local config is set
Browse files Browse the repository at this point in the history
  • Loading branch information
aashwin-rvvup committed Dec 16, 2024
1 parent af9e0a4 commit cc0ff32
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
16 changes: 8 additions & 8 deletions docker/scripts/configure-base-store.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ 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 n98/magerun2-dist 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
bin/magento config:set system/smtp/host $MAGENTO_SMTP_HOST
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
4 changes: 3 additions & 1 deletion docker/scripts/fix-perms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docker/scripts/run-on-local-volume.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
bin/magento config:set payment/rvvup/active 1
16 changes: 9 additions & 7 deletions docker/scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit cc0ff32

Please sign in to comment.