Apply custom patches
Sometimes we provide a custom patch to address a specific issue. Also, third-party extension developers can provide a custom patch. Copy the custom patch to the
/m2-hotfixes directory and test it on your local workstation.
Before beginning an upgrade or a patching process, create an active branch from the Integration environment and checkout the new branch to your local workstation. Dedicating a branch to the upgrade or the patch process helps to avoid interference with your work in progress.
To apply and test a custom patch:
You can only apply patches during the build phase of redeployment.
On your local workstation, create a branch based on the
magento-cloud environment:branch <branch-name>
Copy the patch file to the
Add, commit, and push your code changes.
git add -A && git commit -m "Apply patch" && git push origin <branch name>
After test validation, merge this branch with the
To test if a patch can be applied using your local workstation:
From the project root, apply the patch.
git apply ./m2-hotfixes/<patch-file-name>
Clear the Magento cache.
php ./bin/magento cache:clean
You can also clean the cache using the Magento Admin Cache Management.
Test the patch, make any necessary changes.