diff --git a/docs/recipe/magento2.md b/docs/recipe/magento2.md index 9c7d6b7f8..341d09c07 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,21 @@ 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 + + +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#L413) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L420) Packages all relevant files in an artifact. @@ -648,7 +661,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 +669,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 +677,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 +685,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 +693,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 +710,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 +718,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 +732,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 +740,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 +752,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 +764,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 +784,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 +800,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. diff --git a/recipe/magento2.php b/recipe/magento2.php index be1bf3b6f..74bd53000 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