Skip to content

Commit

Permalink
Fix local builds
Browse files Browse the repository at this point in the history
  • Loading branch information
aashwin-rvvup committed Dec 12, 2024
1 parent b00e8bf commit ea5584e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ services:
- MAGENTO_SMTP_HOST=mailpit
- MAGENTO_SMTP_PORT=1025
volumes:
- "./src/:/bitnami/magento/app/code/Rvvup/PaymentsHyvaCheckout/"
- "./composer.json:/bitnami/magento/app/code/Rvvup/composer.json"
- "./src/:/bitnami/magento/app/code/Rvvup/PaymentsHyvaCheckout/src/"
- "./composer.json:/bitnami/magento/app/code/Rvvup/PaymentsHyvaCheckout/composer.json"
image: magento-hyva-store:latest
depends_on:
- mariadb
Expand Down
3 changes: 2 additions & 1 deletion docker/scripts/configure-base-store.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ bin/magento sampledata:deploy
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 require n98/magerun2-dist
composer config allow-plugins.wikimedia/composer-merge-plugin true
composer require n98/magerun2-dist wikimedia/composer-merge-plugin
3 changes: 1 addition & 2 deletions docker/scripts/configure-hyva.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ composer config repositories.hyva-themes/magento2-default-theme git [email protected]
composer config repositories.hyva-themes/magento2-compat-module-fallback git [email protected]:hyva-themes/magento2-compat-module-fallback.git
composer config repositories.hyva-themes/magento2-order-cancellation-webapi git [email protected]:hyva-themes/magento2-order-cancellation-webapi.git
composer config repositories.hyva-themes/hyva-checkout git [email protected]:hyva-checkout/checkout.git
composer require --prefer-source hyva-themes/magento2-default-theme
composer require --prefer-source hyva-themes/magento2-hyva-checkout:^1.1
composer require --prefer-source hyva-themes/magento2-default-theme hyva-themes/magento2-hyva-checkout:^1.1
bin/magento setup:upgrade

bin/magento config:set dev/template/minify_html 0
Expand Down
8 changes: 1 addition & 7 deletions docker/scripts/configure-rvvup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ rm -rf generated/
if [ "$RVVUP_HYVA_CHECKOUT_VERSION" == "local" ]; then
# Run the command for "local"
echo "Running local version setup..."
# composer config allow-plugins.wikimedia/composer-merge-plugin true
# composer require wikimedia/composer-merge-plugin
# jq '.extra."merge-plugin"."include" += ["app/code/Rvvup/composer.json"]' composer.json > composer-temp.json && mv composer-temp.json composer.json
# jq '.extra."merge-plugin"."merge-dev" = false' composer.json > composer-temp.json && mv composer-temp.json composer.json
# composer update -W
composer require rvvup/module-magento-payments:1.6.0 hyva-themes/magento2-compat-module-fallback:^1.0 hyva-themes/magento2-hyva-checkout:^1.1 magewirephp/magewire:*
mkdir -p app/code/Rvvup/PaymentsHyvaCheckout
mkdir -p app/code/Rvvup/PaymentsHyvaCheckout/src

else
# Run the command for other values
Expand Down
5 changes: 5 additions & 0 deletions docker/scripts/run-on-local-volume.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
echo "Running against local volume"
cd /bitnami/magento/

jq '.extra."merge-plugin"."include" += ["app/code/Rvvup/PaymentsHyvaCheckout/composer.json"]' composer.json > composer-temp.json && mv composer-temp.json composer.json
jq '.extra."merge-plugin"."merge-dev" = false' composer.json > composer-temp.json && mv composer-temp.json composer.json
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
10 changes: 5 additions & 5 deletions scripts/local-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ set -e
BASE_DIR=$(dirname "$(realpath "$0")")
HOST="local.dev.rvvuptech.com:89"
CURRENT_DIR_NAME=$(basename "$PWD")
RVVUP_HYVA_CHECKOUT_VERSION='local'

# Ideally, this commit is pushed to docker hub and we don't rebuild everytime, but for now we rebuild temporarily.
docker compose down -v
docker image rm $CURRENT_DIR_NAME-magento:latest
docker compose up -d
docker compose down -v || true
docker image rm $CURRENT_DIR_NAME-magento:latest || true
RVVUP_HYVA_CHECKOUT_VERSION='local' docker compose up -d
$BASE_DIR/helpers/wait-for-server-startup.sh

echo "Commiting base image"
docker commit $CURRENT_DIR_NAME-magento-1 magento-hyva-store:latest
echo "Restarting server with volume attached"
docker compose -f docker-compose.local.yml up -d
RVVUP_HYVA_CHECKOUT_VERSION='local' docker compose -f docker-compose.local.yml up -d

$BASE_DIR/helpers/wait-for-server-startup.sh
echo -e "\033[32mSuccessfully started up server on http://$HOST\033[0m"
Expand Down

0 comments on commit ea5584e

Please sign in to comment.