From 7b20fa62bb8ebc5864f68836e9ebe3ce915bd7b0 Mon Sep 17 00:00:00 2001 From: Carlos Reynosa Date: Sat, 7 Mar 2026 12:09:08 -0800 Subject: [PATCH 1/4] Fix config import needed on revert. #4180 --- recipe/magento2.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/recipe/magento2.php b/recipe/magento2.php index be1bf3b6f..918ed487c 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -370,7 +370,14 @@ function magentoDeployAssetsSplit(string $area) after('deploy:symlink', 'magento:cache:flush'); -after('deploy:failed', 'magento:maintenance:disable'); +after('deploy:failed','deploy:magento:failed'); + +//Run Magento Deployment Failure Tasks +desc('Run magento post deployment failure tasks.'); +task('deploy:magento:failed',[ + 'magento:config:import', + 'magento:maintenance:disable' +]); // Artifact deployment section From 0c06c6278e258e6f60afe0994161e70e0bcec7d2 Mon Sep 17 00:00:00 2001 From: Carlos Reynosa Date: Sat, 7 Mar 2026 21:53:47 +0000 Subject: [PATCH 2/4] Run docgen --- docs/recipe/magento2.md | 54 +++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/docs/recipe/magento2.md b/docs/recipe/magento2.md index 9c7d6b7f8..b9ee97433 100644 --- a/docs/recipe/magento2.md +++ b/docs/recipe/magento2.md @@ -380,7 +380,7 @@ true ### artifact_file -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L378) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L385) Artifact deployment section The file the artifact is saved to @@ -391,7 +391,7 @@ The file the artifact is saved to ### artifact_dir -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L381) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L388) The directory the artifact is saved in @@ -401,7 +401,7 @@ The directory the artifact is saved in ### artifact_excludes_file -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L385) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L392) Points to a file with a list of files to exclude from packaging. The format is as with the `tar --exclude-from=[file]` option @@ -412,7 +412,7 @@ The format is as with the `tar --exclude-from=[file]` option ### build_from_repo -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L388) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L395) If set to true, the artifact is built from a clean copy of the project repository instead of the current working directory @@ -422,7 +422,7 @@ false ### repository -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L391) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L398) Overrides [repository](/docs/recipe/common.md#repository) from `recipe/common.php`. @@ -434,7 +434,7 @@ null ### artifact_path -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L394) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L401) The relative path to the artifact file. If the directory does not exist, it will be created @@ -447,7 +447,7 @@ return get('artifact_dir') . '/' . get('artifact_file'); ### bin/tar -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L402) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L409) The location of the tar command. On MacOS you should have installed gtar, as it supports the required settings :::info Autogenerated @@ -458,14 +458,14 @@ The value of this configuration is autogenerated on access. ### additional_shared_files -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L474) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L481) Array of shared files that will be added to the default shared_files without overriding ### additional_shared_dirs -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L476) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L483) Array of shared directories that will be added to the default shared_dirs without overriding @@ -639,8 +639,16 @@ This task is group task which contains next tasks: * [deploy:publish](/docs/recipe/common.md#deploy-publish) +### deploy\:magento\:failed {#deploy-magento-failed} +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L377) + +Run magento post deployment failure tasks. + +Run Magento Deployment Failure Tasks + + ### artifact\:package {#artifact-package} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L413) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L420) Packages all relevant files in an artifact. @@ -648,7 +656,7 @@ tasks section ### artifact\:upload {#artifact-upload} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L423) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L430) Uploads artifact in release folder for extraction. @@ -656,7 +664,7 @@ Uploads artifact in release folder for extraction. ### artifact\:extract {#artifact-extract} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L428) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L435) Extracts artifact in release path. @@ -664,7 +672,7 @@ Extracts artifact in release path. ### build\:remove-generated {#build-remove-generated} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L434) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L441) Clears generated files prior to building. @@ -672,7 +680,7 @@ Clears generated files prior to building. ### build\:prepare {#build-prepare} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L439) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L446) Prepare local artifact build. @@ -680,7 +688,7 @@ Prepare local artifact build. ### artifact\:build {#artifact-build} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L464) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L471) Builds an artifact. @@ -697,7 +705,7 @@ This task is group task which contains next tasks: ### deploy\:additional-shared {#deploy-additional-shared} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L480) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L487) Adds additional files and dirs to the list of shared files and dirs. @@ -705,7 +713,7 @@ Adds additional files and dirs to the list of shared files and dirs. ### magento\:set_cache_prefix {#magento-set_cache_prefix} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L495) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L502) Update cache id_prefix. @@ -719,7 +727,7 @@ after('deploy:magento', 'magento:cleanup_cache_prefix'); ### magento\:cleanup_cache_prefix {#magento-cleanup_cache_prefix} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L535) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L542) Cleanup cache id_prefix env files. @@ -727,7 +735,7 @@ After successful deployment, move the tmp_env.php file to env.php ready for next ### magento\:cron\:stop {#magento-cron-stop} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L551) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L558) Remove cron from crontab and kill running cron jobs. @@ -739,7 +747,7 @@ To use this feature, add the following to your deployer scripts: ### magento\:cron\:install {#magento-cron-install} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L567) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L574) Install cron in crontab. @@ -751,7 +759,7 @@ To use this feature, add the following to your deployer scripts: ### artifact\:prepare {#artifact-prepare} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L573) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L580) Prepares an artifact on the target server. @@ -771,7 +779,7 @@ This task is group task which contains next tasks: ### artifact\:finish {#artifact-finish} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L586) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L593) Executes the tasks after artifact is released. @@ -787,7 +795,7 @@ This task is group task which contains next tasks: ### artifact\:deploy {#artifact-deploy} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L595) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L602) Actually releases the artifact deployment. From d1f0fde0a6b7be2f191a6575c012dea5082fa13c Mon Sep 17 00:00:00 2001 From: Carlos Reynosa Date: Sat, 7 Mar 2026 22:05:58 +0000 Subject: [PATCH 3/4] Fix code quality and style --- recipe/magento2.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipe/magento2.php b/recipe/magento2.php index 918ed487c..74bd53000 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -370,13 +370,13 @@ function magentoDeployAssetsSplit(string $area) after('deploy:symlink', 'magento:cache:flush'); -after('deploy:failed','deploy:magento:failed'); +after('deploy:failed', 'deploy:magento:failed'); //Run Magento Deployment Failure Tasks desc('Run magento post deployment failure tasks.'); -task('deploy:magento:failed',[ +task('deploy:magento:failed', [ 'magento:config:import', - 'magento:maintenance:disable' + 'magento:maintenance:disable', ]); // Artifact deployment section From d9252b4d151136212753bc23ae3eb6f4968044c7 Mon Sep 17 00:00:00 2001 From: Carlos Reynosa Date: Sat, 7 Mar 2026 22:13:53 +0000 Subject: [PATCH 4/4] Update docs --- docs/recipe/magento2.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/recipe/magento2.md b/docs/recipe/magento2.md index b9ee97433..341d09c07 100644 --- a/docs/recipe/magento2.md +++ b/docs/recipe/magento2.md @@ -647,6 +647,11 @@ Run magento post deployment failure tasks. Run Magento Deployment Failure Tasks +This task is group task which contains next tasks: +* [magento:config:import](/docs/recipe/magento2.md#magento-config-import) +* [magento:maintenance:disable](/docs/recipe/magento2.md#magento-maintenance-disable) + + ### artifact\:package {#artifact-package} [Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L420)