Closed zzvara closed 4 years ago
Did you even download the patches to your project?
No, how should I do that? Isn't the composer module also for that? The documentation is not very clear to me in this regard.
Moreover, if I upgrade to Magento 2.3.5 I should require this patch, is that so? Is it in the 2.3.5 release?
There’s a blogpost, it explains everything step by step.
I have not tested / checked whether the last patch is still needed for 2.3.5.
I will upgrade the base image in my Dockerfile. Everything, including Baler is automatically built in Docker build anyway. I will report back.
Okay. I checked and the patch is still needed. The remaining question is whether the patch still works on 2.3.5 If it works, everything’s okay.
Otherwise, I’ll need to revise a new patch. If you can report back, it would be appreciated.
What I did:
I'm happy since it is fully reproducable and upgradable and it works. Varnish is not even deployed on the staging environment, but with the custom theme it reports the following:
I can confirm that it works with 2.3.5.
After that what I did is that I copied the production database to staging database, just to reproduce everything, and then I restarted the container. I started to see these:
This is what I do every time the container starts:
echo "Setting up Baler."
sudo -u bitnami php -d memory_limit=8192M bin/magento module:enable Magento_Baler || true
sudo -u bitnami php bin/magento config:set dev/js/enable_baler_js_bundling 1 || true
# Disable incompatible features as suggested by [https://github.com/magento/baler/blob/master/docs/ALPHA.md#disable-incompatible-features-in-magento].
sudo -u bitnami php bin/magento config:set dev/js/minify_files 0 || true
sudo -u bitnami php bin/magento config:set dev/js/enable_js_bundling 0 || true
sudo -u bitnami php bin/magento config:set dev/js/merge_files 0 || true
echo "Running upgrade on Magento."
sudo -u bitnami php -d memory_limit=8192M /opt/bitnami/magento/htdocs/bin/magento setup:upgrade -vvv || true
echo "Running compile on Magento."
sudo -u bitnami php -d memory_limit=8192M /opt/bitnami/magento/htdocs/bin/magento setup:di:compile -vvv || true
echo "Running deployment on Magento sources."
sudo -u bitnami rm -rf pub/static
sudo -u bitnami php -d memory_limit=8192M /opt/bitnami/magento/htdocs/bin/magento setup:static-content:deploy -f -vvv || true
echo "Running Baler."
chmod a+x /usr/local/bin/baler
sudo -u bitnami baler build
All checks out.
This is how I install Baler in the Dockerfile:
# Installing Baler.
RUN git clone https://github.com/magento/baler.git
WORKDIR /opt/bitnami/magento/htdocs/baler
RUN npm install || exit 1
RUN npm test || exit 1
RUN npm run build || exit 1
USER root
RUN npm link || exit 1
USER bitnami:daemon
WORKDIR /opt/bitnami/magento/htdocs
RUN composer require mageplaza/module-core
RUN composer require mageplaza/module-smtp
RUN composer require mageplaza/module-gdpr
RUN composer require mageplaza/magento-2-social-login
RUN composer require dhl/module-rates-express
RUN composer require mageplaza/magento-2-hungarian-language-pack:dev-master
# Continue installing Baler.
RUN sed -i "s|\"minimum-stability\": \"stable\"|\"minimum-stability\": \"dev\",\n\"prefer-stable\": true|g" composer.json
RUN echo "Composer JSON updated as follows:"
RUN cat composer.json
RUN composer config repositories.magento-baler vcs git@github.com:magento/m2-baler.git
RUN composer require magento/module-baler:dev-master
# Fix for Baler as showed on [https://www.integer-net.com/magento-2-javascript-bundling-setup-default/#bundling-patches].
RUN wget https://github.com/magento/magento2/pull/25587.diff || exit 1
RUN mkdir -p patches/composer/M234/
RUN mv 25587.diff patches/composer/M234/25587.diff
RUN composer require cweagans/composer-patches || exit 1
RUN sed -i "s|\"magento-force\": \"override\"|\"magento-force\": \"override\",\n\"composer-exit-on-patch-failure\": true,\n\"patches\": {\n\"magento/magento2-base\": {\n\"Refactor JavaScript mixins module https://github.com/magento/magento2/pull/25587\": \"patches/composer/M234/25587.diff\"\n}\n}|g" composer.json || exit 1
RUN composer install || exit 1