capistrano-magento2 icon indicating copy to clipboard operation
capistrano-magento2 copied to clipboard

Support for Quality Patches Tool

Open bluec opened this issue 2 years ago • 2 comments

Would be nice to have support for the Magento Quality Patches Tool.

Meanwhile, can anyone improve on this for me? It works but I've no idea if it is robust or correct...

(As an aside, does anyone know how the tool keeps track of which patches were applied?)

# Magento Quality Patches Tool
SSHKit.config.command_map[:magento_qp] = "/usr/bin/env php -f vendor/bin/magento-patches --"
set :magento_quality_patches, "ACSD-47079"

# Apply quality patches
namespace :local do
    namespace :patches do
        task :apply do
            if fetch(:magento_quality_patches)
                desc "Applying quality patches"
                on primary fetch(:magento_deploy_setup_role) do
                    within release_path do
                        execute :magento_qp, "apply #{fetch(:magento_quality_patches)} -n"
                    end
                end
            end
        end
    end
end

after "magento:composer:install", "local:patches:apply"

bluec avatar May 09 '23 14:05 bluec

@bluec I'm sure by now Claude Code or the like can help answer this question for you. :)

But for what it's worth, we don't use the magento-patches tool but instead get the patches and apply them using the composer-patches tool: https://gist.github.com/erikhansen/1b18980b39464dc94b9f09282a43ea31#apply-patches-using-the-composer-patches-plugin

erikhansen avatar Nov 05 '25 20:11 erikhansen

@erikhansen thanks for this, I've been successfully using my approach above and also have a separate task for applying composer patches. Never thought of manually downloading and applying the magento quality patches so I'll keep this in mind.

bluec avatar Nov 06 '25 07:11 bluec