From fd85350e6edfccdccb6933d92a3feeb1bd5c44bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joda=20Sto=CC=88=C3=9Fer?= Date: Fri, 17 May 2024 13:09:24 +0300 Subject: [PATCH 1/6] docs(recipe/magento2): add line breaks --- docs/recipe/magento2.md | 117 ++++++++++++++++++++-------------------- recipe/magento2.php | 9 ++-- 2 files changed, 64 insertions(+), 62 deletions(-) diff --git a/docs/recipe/magento2.md b/docs/recipe/magento2.md index 7e83e7801..16f765865 100644 --- a/docs/recipe/magento2.md +++ b/docs/recipe/magento2.md @@ -127,15 +127,16 @@ in you deployer script. ### magento_themes -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L43) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L44) You can also set the themes to run against. By default it'll deploy all themes - `add('magento_themes', ['Magento/luma', 'Magento/backend']);` + If the themes are set as a simple list of strings, then all languages defined in [static_content_locales](/docs/recipe/magento2.md#static_content_locales) are compiled for the given themes. Alternatively The themes can be defined as an associative array, where the key represents the theme name and -the key contains the languages for the compilation (for this specific theme) -Example: +the key contains the languages for the compilation (for this specific theme). +Examples: set('magento_themes', ['Magento/luma']); - Will compile this theme with every language from [static_content_locales](/docs/recipe/magento2.md#static_content_locales) set('magento_themes', [ 'Magento/luma' => null, - Will compile all languages from [static_content_locales](/docs/recipe/magento2.md#static_content_locales) for Magento/luma @@ -151,14 +152,14 @@ set('magento_themes', [ ### static_deploy_options -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L48) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L49) Static content deployment options, e.g. '--no-parent' ### split_static_deployment -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L51) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L52) Deploy frontend and adminhtml together as default @@ -168,7 +169,7 @@ false ### static_content_locales_backend -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L54) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L55) Use the default languages for the backend as default @@ -178,7 +179,7 @@ Use the default languages for the backend as default ### magento_themes_backend -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L58) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L59) backend themes to deploy. Only used if split_static_deployment=true This setting supports the same options/structure as [magento_themes](/docs/recipe/magento2.md#magento_themes) @@ -189,7 +190,7 @@ This setting supports the same options/structure as [magento_themes](/docs/recip ### static_content_jobs -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L64) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L65) Also set the number of conccurent jobs to run. The default is 1 Update using: `set('static_content_jobs', '1');` @@ -200,7 +201,7 @@ Update using: `set('static_content_jobs', '1');` ### content_version -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L66) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L67) @@ -210,7 +211,7 @@ return time(); ### magento_dir -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L71) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L72) Magento directory relative to repository root. Use "." (default) if it is not located in a subdirectory @@ -220,7 +221,7 @@ Magento directory relative to repository root. Use "." (default) if it is not lo ### shared_files -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L74) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L75) Overrides [shared_files](/docs/recipe/deploy/shared.md#shared_files) from `recipe/deploy/shared.php`. @@ -235,7 +236,7 @@ Overrides [shared_files](/docs/recipe/deploy/shared.md#shared_files) from `recip ### shared_dirs -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L78) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L79) Overrides [shared_dirs](/docs/recipe/deploy/shared.md#shared_dirs) from `recipe/deploy/shared.php`. @@ -261,7 +262,7 @@ Overrides [shared_dirs](/docs/recipe/deploy/shared.md#shared_dirs) from `recipe/ ### writable_dirs -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L93) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L94) Overrides [writable_dirs](/docs/recipe/deploy/writable.md#writable_dirs) from `recipe/deploy/writable.php`. @@ -279,7 +280,7 @@ Overrides [writable_dirs](/docs/recipe/deploy/writable.md#writable_dirs) from `r ### clear_paths -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L100) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L101) Overrides [clear_paths](/docs/recipe/deploy/clear_paths.md#clear_paths) from `recipe/deploy/clear_paths.php`. @@ -298,7 +299,7 @@ Overrides [clear_paths](/docs/recipe/deploy/clear_paths.md#clear_paths) from `re ### bin/magento -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L109) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L110) @@ -308,7 +309,7 @@ Overrides [clear_paths](/docs/recipe/deploy/clear_paths.md#clear_paths) from `re ### magento_version -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L111) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L112) @@ -321,7 +322,7 @@ return $matches[0] ?? '2.0'; ### config_import_needed -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L118) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L119) :::info Autogenerated @@ -332,7 +333,7 @@ The value of this configuration is autogenerated on access. ### database_upgrade_needed -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L132) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L133) :::info Autogenerated @@ -343,7 +344,7 @@ The value of this configuration is autogenerated on access. ### enable_zerodowntime -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L157) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L158) Deploy without setting maintenance mode if possible @@ -353,7 +354,7 @@ true ### artifact_file -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L343) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L344) The file the artifact is saved to @@ -363,7 +364,7 @@ The file the artifact is saved to ### artifact_dir -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L346) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L347) The directory the artifact is saved in @@ -373,7 +374,7 @@ The directory the artifact is saved in ### artifact_excludes_file -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L350) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L351) Points to a file with a list of files to exclude from packaging. The format is as with the `tar --exclude-from=[file]` option @@ -384,7 +385,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#L353) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L354) If set to true, the artifact is built from a clean copy of the project repository instead of the current working directory @@ -394,7 +395,7 @@ false ### repository -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L356) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L357) Overrides [repository](/docs/recipe/common.md#repository) from `recipe/common.php`. @@ -406,7 +407,7 @@ null ### artifact_path -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L359) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L360) The relative path to the artifact file. If the directory does not exist, it will be created @@ -419,7 +420,7 @@ return get('artifact_dir') . '/' . get('artifact_file'); ### bin/tar -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L367) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L368) The location of the tar command. On MacOS you should have installed gtar, as it supports the required settings :::info Autogenerated @@ -430,14 +431,14 @@ The value of this configuration is autogenerated on access. ### additional_shared_files -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L439) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L440) 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#L441) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L442) Array of shared directories that will be added to the default shared_dirs without overriding @@ -447,7 +448,7 @@ Array of shared directories that will be added to the default shared_dirs withou ## Tasks ### magento:compile -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L167) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L168) Compiles magento di. @@ -459,7 +460,7 @@ e.g. ### magento:deploy:assets -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L193) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L194) Deploys assets. @@ -486,7 +487,7 @@ in `app/etc/config.php`, e.g.: ### magento:deploy:assets:adminhtml -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L209) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L210) Deploys assets for backend only. @@ -494,7 +495,7 @@ Deploys assets for backend only. ### magento:deploy:assets:frontend -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L214) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L215) Deploys assets for frontend only. @@ -502,7 +503,7 @@ Deploys assets for frontend only. ### magento:sync:content_version -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L262) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L263) Syncs content version. @@ -510,7 +511,7 @@ Syncs content version. ### magento:maintenance:enable -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L272) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L273) Enables maintenance mode. @@ -518,7 +519,7 @@ Enables maintenance mode. ### magento:maintenance:disable -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L278) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L279) Disables maintenance mode. @@ -526,7 +527,7 @@ Disables maintenance mode. ### magento:maintenance:enable-if-needed -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L284) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L285) Set maintenance mode if needed. @@ -534,7 +535,7 @@ Set maintenance mode if needed. ### magento:config:import -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L291) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L292) Config Import. @@ -542,7 +543,7 @@ Config Import. ### magento:upgrade:db -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L300) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L301) Upgrades magento database. @@ -550,7 +551,7 @@ Upgrades magento database. ### magento:cache:flush -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L309) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L310) Flushes Magento Cache. @@ -558,7 +559,7 @@ Flushes Magento Cache. ### deploy:magento -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L314) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L315) Magento2 deployment operations. @@ -575,7 +576,7 @@ This task is group task which contains next tasks: ### magento:build -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L324) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L325) Magento2 build operations. @@ -588,7 +589,7 @@ This task is group task which contains next tasks: ### deploy -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L330) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L331) Deploys your project. @@ -604,7 +605,7 @@ This task is group task which contains next tasks: ### artifact:package -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L378) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L379) Packages all relevant files in an artifact. @@ -612,7 +613,7 @@ Packages all relevant files in an artifact. ### artifact:upload -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L388) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L389) Uploads artifact in release folder for extraction. @@ -620,7 +621,7 @@ Uploads artifact in release folder for extraction. ### artifact:extract -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L393) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L394) Extracts artifact in release path. @@ -628,7 +629,7 @@ Extracts artifact in release path. ### build:remove-generated -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L399) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L400) Clears generated files prior to building. @@ -636,7 +637,7 @@ Clears generated files prior to building. ### build:prepare -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L404) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L405) Prepare local artifact build. @@ -644,7 +645,7 @@ Prepare local artifact build. ### artifact:build -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L429) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L430) Builds an artifact. @@ -661,7 +662,7 @@ This task is group task which contains next tasks: ### deploy:additional-shared -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L445) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L446) Adds additional files and dirs to the list of shared files and dirs. @@ -669,12 +670,12 @@ Adds additional files and dirs to the list of shared files and dirs. ### magento:set_cache_prefix -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L460) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L461) Update cache id_prefix. -Update cache id_prefix on deploy so that you are compiling against a fresh cache -Reference Issue: https://github.com/davidalger/capistrano-magento2/issues/151 +Update cache id_prefix on deploy so that you are compiling against a fresh cache +Reference Issue: https://github.com/davidalger/capistrano-magento2/issues/151 To use this feature, add the following to your deployer scripts: ```php after('deploy:shared', 'magento:set_cache_prefix'); @@ -683,7 +684,7 @@ after('deploy:magento', 'magento:cleanup_cache_prefix'); ### magento:cleanup_cache_prefix -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L500) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L501) Cleanup cache id_prefix env files. @@ -691,7 +692,7 @@ After successful deployment, move the tmp_env.php file to env.php ready for next ### magento:cron:stop -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L516) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L517) Remove cron from crontab and kill running cron jobs. @@ -703,7 +704,7 @@ To use this feature, add the following to your deployer scripts: ### magento:cron:install -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L532) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L533) Install cron in crontab. @@ -715,7 +716,7 @@ To use this feature, add the following to your deployer scripts: ### artifact:prepare -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L538) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L539) Prepares an artifact on the target server. @@ -735,7 +736,7 @@ This task is group task which contains next tasks: ### artifact:finish -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L551) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L552) Executes the tasks after artifact is released. @@ -750,7 +751,7 @@ This task is group task which contains next tasks: ### artifact:deploy -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L560) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L561) Actually releases the artifact deployment. diff --git a/recipe/magento2.php b/recipe/magento2.php index fdfe6d24f..4bdf4f513 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -29,11 +29,12 @@ // You can also set the themes to run against. By default it'll deploy // all themes - `add('magento_themes', ['Magento/luma', 'Magento/backend']);` +// // If the themes are set as a simple list of strings, then all languages defined in {{static_content_locales}} are // compiled for the given themes. // Alternatively The themes can be defined as an associative array, where the key represents the theme name and -// the key contains the languages for the compilation (for this specific theme) -// Example: +// the key contains the languages for the compilation (for this specific theme). +// Examples: // set('magento_themes', ['Magento/luma']); - Will compile this theme with every language from {{static_content_locales}} // set('magento_themes', [ // 'Magento/luma' => null, - Will compile all languages from {{static_content_locales}} for Magento/luma @@ -448,8 +449,8 @@ function magentoDeployAssetsSplit(string $area) }); /** - * Update cache id_prefix on deploy so that you are compiling against a fresh cache - * Reference Issue: https://github.com/davidalger/capistrano-magento2/issues/151 + * Update cache id_prefix on deploy so that you are compiling against a fresh cache + * Reference Issue: https://github.com/davidalger/capistrano-magento2/issues/151 * To use this feature, add the following to your deployer scripts: * ```php * after('deploy:shared', 'magento:set_cache_prefix'); From 43ec3306fd8a68b5f1a7c2807970c6efa1875f65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joda=20Sto=CC=88=C3=9Fer?= Date: Fri, 17 May 2024 19:43:00 +0300 Subject: [PATCH 2/6] docs(recipe/magento2): captitalise Magento in task descriptions --- docs/recipe/magento2.md | 12 ++++++------ recipe/magento2.php | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/recipe/magento2.md b/docs/recipe/magento2.md index 16f765865..43a4b4be6 100644 --- a/docs/recipe/magento2.md +++ b/docs/recipe/magento2.md @@ -40,11 +40,11 @@ The [deploy](#deploy) task of **Magento 2** consists of: * [deploy:clear_paths](/docs/recipe/deploy/clear_paths.md#deployclear_paths) – Cleanup files and/or directories * [deploy:magento](/docs/recipe/magento2.md#deploymagento) – Magento2 deployment operations * [magento:build](/docs/recipe/magento2.md#magentobuild) – Magento2 build operations - * [magento:compile](/docs/recipe/magento2.md#magentocompile) – Compiles magento di + * [magento:compile](/docs/recipe/magento2.md#magentocompile) – Compiles Magento di * [magento:deploy:assets](/docs/recipe/magento2.md#magentodeployassets) – Deploys assets * [magento:maintenance:enable-if-needed](/docs/recipe/magento2.md#magentomaintenanceenable-if-needed) – Set maintenance mode if needed * [magento:config:import](/docs/recipe/magento2.md#magentoconfigimport) – Config Import - * [magento:upgrade:db](/docs/recipe/magento2.md#magentoupgradedb) – Upgrades magento database + * [magento:upgrade:db](/docs/recipe/magento2.md#magentoupgradedb) – Upgrades Magento database * [magento:maintenance:disable](/docs/recipe/magento2.md#magentomaintenancedisable) – Disables maintenance mode * [magento:cache:flush](/docs/recipe/magento2.md#magentocacheflush) – Flushes Magento Cache * [deploy:publish](/docs/recipe/common.md#deploypublish) – Publishes the release @@ -83,7 +83,7 @@ to your deploy yaml. The [artifact:build](#artifact:build) command of **Magento 2** consists of: * [build:prepare](/docs/recipe/magento2.md#buildprepare) – Prepare local artifact build * [build:remove-generated](/docs/recipe/magento2.md#buildremove-generated) – Clears generated files prior to building. * [deploy:vendors](/docs/recipe/deploy/vendors.md#deployvendors) – Installs vendors -* [magento:compile](/docs/recipe/magento2.md#magentocompile) – Compiles magento di +* [magento:compile](/docs/recipe/magento2.md#magentocompile) – Compiles Magento di * [magento:deploy:assets](/docs/recipe/magento2.md#magentodeployassets) – Deploys assets * [artifact:package](/docs/recipe/magento2.md#artifactpackage) – Packages all relevant files in an artifact. @@ -101,7 +101,7 @@ The [artifact:build](#artifact:build) command of **Magento 2** consists of: * [b * [deploy:writable](/docs/recipe/deploy/writable.md#deploywritable) – Makes writable dirs * [magento:maintenance:enable-if-needed](/docs/recipe/magento2.md#magentomaintenanceenable-if-needed) – Set maintenance mode if needed * [magento:config:import](/docs/recipe/magento2.md#magentoconfigimport) – Config Import -* [magento:upgrade:db](/docs/recipe/magento2.md#magentoupgradedb) – Upgrades magento database +* [magento:upgrade:db](/docs/recipe/magento2.md#magentoupgradedb) – Upgrades Magento database * [magento:maintenance:disable](/docs/recipe/magento2.md#magentomaintenancedisable) – Disables maintenance mode * [deploy:symlink](/docs/recipe/deploy/symlink.md#deploysymlink) – Creates symlink to release * [artifact:finish](/docs/recipe/magento2.md#artifactfinish) – Executes the tasks after artifact is released @@ -450,7 +450,7 @@ Array of shared directories that will be added to the default shared_dirs withou ### magento:compile [Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L168) -Compiles magento di. +Compiles Magento di. To work correctly with artifact deployment, it is necessary to set the MAGE_MODE correctly in `app/etc/config.php` e.g. @@ -545,7 +545,7 @@ Config Import. ### magento:upgrade:db [Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L301) -Upgrades magento database. +Upgrades Magento database. diff --git a/recipe/magento2.php b/recipe/magento2.php index 4bdf4f513..ead8660e2 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -164,7 +164,7 @@ // ```php // 'MAGE_MODE' => 'production' // ``` -desc('Compiles magento di'); +desc('Compiles Magento di'); task('magento:compile', function () { run("{{bin/php}} {{bin/magento}} setup:di:compile"); run('cd {{release_or_current_path}}/{{magento_dir}} && {{bin/composer}} dump-autoload -o'); @@ -297,7 +297,7 @@ function magentoDeployAssetsSplit(string $area) } }); -desc('Upgrades magento database'); +desc('Upgrades Magento database'); task('magento:upgrade:db', function () { if (get('database_upgrade_needed')) { run("{{bin/php}} {{bin/magento}} setup:upgrade --keep-generated --no-interaction"); From 449e85b14bf3f94aa1a75ba726965cf14f240d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joda=20Sto=CC=88=C3=9Fer?= Date: Fri, 17 May 2024 19:43:38 +0300 Subject: [PATCH 3/6] docs(recipe/magento2): highlight file names in italic --- docs/recipe/magento2.md | 2 +- recipe/magento2.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/recipe/magento2.md b/docs/recipe/magento2.md index 43a4b4be6..349f9082b 100644 --- a/docs/recipe/magento2.md +++ b/docs/recipe/magento2.md @@ -688,7 +688,7 @@ after('deploy:magento', 'magento:cleanup_cache_prefix'); Cleanup cache id_prefix env files. -After successful deployment, move the tmp_env.php file to env.php ready for next deployment +After successful deployment, move the _tmp_env.php_ file to _env.php_ ready for next deployment ### magento:cron:stop diff --git a/recipe/magento2.php b/recipe/magento2.php index ead8660e2..2ede05ba1 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -495,7 +495,7 @@ function magentoDeployAssetsSplit(string $area) }); /** - * After successful deployment, move the tmp_env.php file to env.php ready for next deployment + * After successful deployment, move the _tmp_env.php_ file to _env.php_ ready for next deployment */ desc('Cleanup cache id_prefix env files'); task('magento:cleanup_cache_prefix', function () { From 32b7ae31970e249106eeec3146b7571d2fbe3f05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joda=20Sto=CC=88=C3=9Fer?= Date: Fri, 17 May 2024 19:43:52 +0300 Subject: [PATCH 4/6] docs(recipe/magento2): remove duplicate phrasing --- docs/recipe/magento2.md | 9 ++++----- recipe/magento2.php | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/recipe/magento2.md b/docs/recipe/magento2.md index 349f9082b..695b21c24 100644 --- a/docs/recipe/magento2.md +++ b/docs/recipe/magento2.md @@ -704,11 +704,10 @@ To use this feature, add the following to your deployer scripts: ### magento:cron:install -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L533) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L532) Install cron in crontab. -Install cron in crontab To use this feature, add the following to your deployer scripts: ```php after('magento:upgrade:db', 'magento:cron:install'); @@ -716,7 +715,7 @@ To use this feature, add the following to your deployer scripts: ### artifact:prepare -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L539) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L538) Prepares an artifact on the target server. @@ -736,7 +735,7 @@ This task is group task which contains next tasks: ### artifact:finish -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L552) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L551) Executes the tasks after artifact is released. @@ -751,7 +750,7 @@ This task is group task which contains next tasks: ### artifact:deploy -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L561) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L560) Actually releases the artifact deployment. diff --git a/recipe/magento2.php b/recipe/magento2.php index 2ede05ba1..b3ffd3d53 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -523,7 +523,6 @@ function magentoDeployAssetsSplit(string $area) }); /** - * Install cron in crontab * To use this feature, add the following to your deployer scripts: * ```php * after('magento:upgrade:db', 'magento:cron:install'); From f5e4d3603518b7b2d56e9bf1c85696cd32051ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joda=20Sto=CC=88=C3=9Fer?= Date: Fri, 17 May 2024 19:49:08 +0300 Subject: [PATCH 5/6] docs(recipe/magento2): change quote syntax to highlight code --- docs/recipe/magento2.md | 6 +++--- recipe/magento2.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/recipe/magento2.md b/docs/recipe/magento2.md index 695b21c24..6c33ee494 100644 --- a/docs/recipe/magento2.md +++ b/docs/recipe/magento2.md @@ -154,7 +154,7 @@ set('magento_themes', [ ### static_deploy_options [Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L49) -Static content deployment options, e.g. '--no-parent' +Static content deployment options, e.g. `--no-parent` @@ -213,7 +213,7 @@ return time(); ### magento_dir [Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L72) -Magento directory relative to repository root. Use "." (default) if it is not located in a subdirectory +Magento directory relative to repository root. Use '.' (default) if it is not located in a subdirectory ```php title="Default value" '.' @@ -399,7 +399,7 @@ false Overrides [repository](/docs/recipe/common.md#repository) from `recipe/common.php`. -Set this value if "build_from_repo" is set to true. The target to deploy must also be set with "--branch", "--tag" or "--revision" +Set this value if `build_from_repo` is set to true. The target to deploy must also be set with `--branch`, `--tag` or `--revision` ```php title="Default value" null diff --git a/recipe/magento2.php b/recipe/magento2.php index b3ffd3d53..60dce8d15 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -45,7 +45,7 @@ ]); -// Static content deployment options, e.g. '--no-parent' +// Static content deployment options, e.g. `--no-parent` set('static_deploy_options', ''); // Deploy frontend and adminhtml together as default @@ -68,7 +68,7 @@ return time(); }); -// Magento directory relative to repository root. Use "." (default) if it is not located in a subdirectory +// Magento directory relative to repository root. Use '.' (default) if it is not located in a subdirectory set('magento_dir', '.'); @@ -353,7 +353,7 @@ function magentoDeployAssetsSplit(string $area) // If set to true, the artifact is built from a clean copy of the project repository instead of the current working directory set('build_from_repo', false); -// Set this value if "build_from_repo" is set to true. The target to deploy must also be set with "--branch", "--tag" or "--revision" +// Set this value if `build_from_repo` is set to true. The target to deploy must also be set with `--branch`, `--tag` or `--revision` set('repository', null); // The relative path to the artifact file. If the directory does not exist, it will be created From 8a258b33f9607a875ac679a3a101443c7c80590f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joda=20Sto=CC=88=C3=9Fer?= Date: Fri, 17 May 2024 19:49:35 +0300 Subject: [PATCH 6/6] docs(recipe/magento2): add code highlights --- docs/recipe/magento2.md | 126 ++++++++++++++++++++-------------------- recipe/magento2.php | 14 +++-- 2 files changed, 72 insertions(+), 68 deletions(-) diff --git a/docs/recipe/magento2.md b/docs/recipe/magento2.md index 6c33ee494..efa85b478 100644 --- a/docs/recipe/magento2.md +++ b/docs/recipe/magento2.md @@ -117,7 +117,7 @@ The magento2 recipe is based on the [common](/docs/recipe/common.md) recipe. ### static_content_locales [Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L26) -By default setup:static-content:deploy uses `en_US`. +By default `setup:static-content:deploy` uses `en_US`. To change that, simply put `set('static_content_locales', 'en_US de_DE');` in you deployer script. @@ -127,7 +127,7 @@ in you deployer script. ### magento_themes -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L44) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L46) You can also set the themes to run against. By default it'll deploy all themes - `add('magento_themes', ['Magento/luma', 'Magento/backend']);` @@ -137,12 +137,14 @@ compiled for the given themes. Alternatively The themes can be defined as an associative array, where the key represents the theme name and the key contains the languages for the compilation (for this specific theme). Examples: -set('magento_themes', ['Magento/luma']); - Will compile this theme with every language from [static_content_locales](/docs/recipe/magento2.md#static_content_locales) +`set('magento_themes', ['Magento/luma']);` - Will compile this theme with every language from [static_content_locales](/docs/recipe/magento2.md#static_content_locales) +``` set('magento_themes', [ - 'Magento/luma' => null, - Will compile all languages from [static_content_locales](/docs/recipe/magento2.md#static_content_locales) for Magento/luma + 'Magento/luma' => null, - Will compile all languages from {{static_content_locales}} for Magento/luma 'Custom/theme' => 'en_US fr_FR' - Will compile only en_US and fr_FR for Custom/theme - 'Custom/another' => '[static_content_locales](/docs/recipe/magento2.md#static_content_locales) it_IT' - Will compile all languages from [static_content_locales](/docs/recipe/magento2.md#static_content_locales) + it_IT for Custom/another + 'Custom/another' => '{{static_content_locales}} it_IT' - Will compile all languages from {{static_content_locales}} + it_IT for Custom/another ]); - Will compile this theme with every language +``` ```php title="Default value" [ @@ -152,14 +154,14 @@ set('magento_themes', [ ### static_deploy_options -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L49) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L51) Static content deployment options, e.g. `--no-parent` ### split_static_deployment -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L52) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L54) Deploy frontend and adminhtml together as default @@ -169,7 +171,7 @@ false ### static_content_locales_backend -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L55) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L57) Use the default languages for the backend as default @@ -179,9 +181,9 @@ Use the default languages for the backend as default ### magento_themes_backend -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L59) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L61) -backend themes to deploy. Only used if split_static_deployment=true +backend themes to deploy. Only used if `split_static_deployment=true` This setting supports the same options/structure as [magento_themes](/docs/recipe/magento2.md#magento_themes) ```php title="Default value" @@ -190,7 +192,7 @@ This setting supports the same options/structure as [magento_themes](/docs/recip ### static_content_jobs -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L65) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L67) Also set the number of conccurent jobs to run. The default is 1 Update using: `set('static_content_jobs', '1');` @@ -201,7 +203,7 @@ Update using: `set('static_content_jobs', '1');` ### content_version -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L67) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L69) @@ -211,9 +213,9 @@ return time(); ### magento_dir -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L72) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L74) -Magento directory relative to repository root. Use '.' (default) if it is not located in a subdirectory +Magento directory relative to repository root. Use `'.'` (default) if it is not located in a subdirectory ```php title="Default value" '.' @@ -221,7 +223,7 @@ Magento directory relative to repository root. Use '.' (default) if it is not lo ### shared_files -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L75) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L77) Overrides [shared_files](/docs/recipe/deploy/shared.md#shared_files) from `recipe/deploy/shared.php`. @@ -236,7 +238,7 @@ Overrides [shared_files](/docs/recipe/deploy/shared.md#shared_files) from `recip ### shared_dirs -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L79) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L81) Overrides [shared_dirs](/docs/recipe/deploy/shared.md#shared_dirs) from `recipe/deploy/shared.php`. @@ -262,7 +264,7 @@ Overrides [shared_dirs](/docs/recipe/deploy/shared.md#shared_dirs) from `recipe/ ### writable_dirs -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L94) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L96) Overrides [writable_dirs](/docs/recipe/deploy/writable.md#writable_dirs) from `recipe/deploy/writable.php`. @@ -280,7 +282,7 @@ Overrides [writable_dirs](/docs/recipe/deploy/writable.md#writable_dirs) from `r ### clear_paths -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L101) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L103) Overrides [clear_paths](/docs/recipe/deploy/clear_paths.md#clear_paths) from `recipe/deploy/clear_paths.php`. @@ -299,7 +301,7 @@ Overrides [clear_paths](/docs/recipe/deploy/clear_paths.md#clear_paths) from `re ### bin/magento -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L110) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L112) @@ -309,7 +311,7 @@ Overrides [clear_paths](/docs/recipe/deploy/clear_paths.md#clear_paths) from `re ### magento_version -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L112) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L114) @@ -322,7 +324,7 @@ return $matches[0] ?? '2.0'; ### config_import_needed -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L119) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L121) :::info Autogenerated @@ -333,7 +335,7 @@ The value of this configuration is autogenerated on access. ### database_upgrade_needed -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L133) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L135) :::info Autogenerated @@ -344,7 +346,7 @@ The value of this configuration is autogenerated on access. ### enable_zerodowntime -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L158) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L160) Deploy without setting maintenance mode if possible @@ -354,7 +356,7 @@ true ### artifact_file -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L344) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L346) The file the artifact is saved to @@ -364,7 +366,7 @@ The file the artifact is saved to ### artifact_dir -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L347) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L349) The directory the artifact is saved in @@ -374,7 +376,7 @@ The directory the artifact is saved in ### artifact_excludes_file -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L351) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L353) Points to a file with a list of files to exclude from packaging. The format is as with the `tar --exclude-from=[file]` option @@ -385,7 +387,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#L354) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L356) If set to true, the artifact is built from a clean copy of the project repository instead of the current working directory @@ -395,11 +397,11 @@ false ### repository -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L357) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L359) Overrides [repository](/docs/recipe/common.md#repository) from `recipe/common.php`. -Set this value if `build_from_repo` is set to true. The target to deploy must also be set with `--branch`, `--tag` or `--revision` +Set this value if `build_from_repo` is set to `true`. The target to deploy must also be set with `--branch`, `--tag` or `--revision` ```php title="Default value" null @@ -407,7 +409,7 @@ null ### artifact_path -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L360) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L362) The relative path to the artifact file. If the directory does not exist, it will be created @@ -420,7 +422,7 @@ return get('artifact_dir') . '/' . get('artifact_file'); ### bin/tar -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L368) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L370) The location of the tar command. On MacOS you should have installed gtar, as it supports the required settings :::info Autogenerated @@ -431,14 +433,14 @@ The value of this configuration is autogenerated on access. ### additional_shared_files -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L440) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L442) 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#L442) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L444) Array of shared directories that will be added to the default shared_dirs without overriding @@ -448,11 +450,11 @@ Array of shared directories that will be added to the default shared_dirs withou ## Tasks ### magento:compile -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L168) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L170) Compiles Magento di. -To work correctly with artifact deployment, it is necessary to set the MAGE_MODE correctly in `app/etc/config.php` +To work correctly with artifact deployment, it is necessary to set the `MAGE_MODE` correctly in `app/etc/config.php` e.g. ```php 'MAGE_MODE' => 'production' @@ -460,7 +462,7 @@ e.g. ### magento:deploy:assets -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L194) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L196) Deploys assets. @@ -487,7 +489,7 @@ in `app/etc/config.php`, e.g.: ### magento:deploy:assets:adminhtml -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L210) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L212) Deploys assets for backend only. @@ -495,7 +497,7 @@ Deploys assets for backend only. ### magento:deploy:assets:frontend -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L215) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L217) Deploys assets for frontend only. @@ -503,7 +505,7 @@ Deploys assets for frontend only. ### magento:sync:content_version -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L263) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L265) Syncs content version. @@ -511,7 +513,7 @@ Syncs content version. ### magento:maintenance:enable -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L273) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L275) Enables maintenance mode. @@ -519,7 +521,7 @@ Enables maintenance mode. ### magento:maintenance:disable -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L279) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L281) Disables maintenance mode. @@ -527,7 +529,7 @@ Disables maintenance mode. ### magento:maintenance:enable-if-needed -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L285) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L287) Set maintenance mode if needed. @@ -535,7 +537,7 @@ Set maintenance mode if needed. ### magento:config:import -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L292) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L294) Config Import. @@ -543,7 +545,7 @@ Config Import. ### magento:upgrade:db -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L301) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L303) Upgrades Magento database. @@ -551,7 +553,7 @@ Upgrades Magento database. ### magento:cache:flush -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L310) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L312) Flushes Magento Cache. @@ -559,7 +561,7 @@ Flushes Magento Cache. ### deploy:magento -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L315) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L317) Magento2 deployment operations. @@ -576,7 +578,7 @@ This task is group task which contains next tasks: ### magento:build -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L325) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L327) Magento2 build operations. @@ -589,7 +591,7 @@ This task is group task which contains next tasks: ### deploy -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L331) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L333) Deploys your project. @@ -605,7 +607,7 @@ This task is group task which contains next tasks: ### artifact:package -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L379) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L381) Packages all relevant files in an artifact. @@ -613,7 +615,7 @@ Packages all relevant files in an artifact. ### artifact:upload -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L389) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L391) Uploads artifact in release folder for extraction. @@ -621,7 +623,7 @@ Uploads artifact in release folder for extraction. ### artifact:extract -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L394) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L396) Extracts artifact in release path. @@ -629,7 +631,7 @@ Extracts artifact in release path. ### build:remove-generated -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L400) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L402) Clears generated files prior to building. @@ -637,7 +639,7 @@ Clears generated files prior to building. ### build:prepare -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L405) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L407) Prepare local artifact build. @@ -645,7 +647,7 @@ Prepare local artifact build. ### artifact:build -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L430) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L432) Builds an artifact. @@ -662,7 +664,7 @@ This task is group task which contains next tasks: ### deploy:additional-shared -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L446) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L448) Adds additional files and dirs to the list of shared files and dirs. @@ -670,7 +672,7 @@ Adds additional files and dirs to the list of shared files and dirs. ### magento:set_cache_prefix -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L461) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L463) Update cache id_prefix. @@ -684,7 +686,7 @@ after('deploy:magento', 'magento:cleanup_cache_prefix'); ### magento:cleanup_cache_prefix -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L501) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L503) Cleanup cache id_prefix env files. @@ -692,7 +694,7 @@ After successful deployment, move the _tmp_env.php_ file to _env.php_ ready for ### magento:cron:stop -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L517) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L519) Remove cron from crontab and kill running cron jobs. @@ -704,7 +706,7 @@ To use this feature, add the following to your deployer scripts: ### magento:cron:install -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L532) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L534) Install cron in crontab. @@ -715,7 +717,7 @@ To use this feature, add the following to your deployer scripts: ### artifact:prepare -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L538) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L540) Prepares an artifact on the target server. @@ -735,7 +737,7 @@ This task is group task which contains next tasks: ### artifact:finish -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L551) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L553) Executes the tasks after artifact is released. @@ -750,7 +752,7 @@ This task is group task which contains next tasks: ### artifact:deploy -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L560) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L562) Actually releases the artifact deployment. diff --git a/recipe/magento2.php b/recipe/magento2.php index 60dce8d15..37eb800bc 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -20,7 +20,7 @@ // Configuration -// By default setup:static-content:deploy uses `en_US`. +// By default `setup:static-content:deploy` uses `en_US`. // To change that, simply put `set('static_content_locales', 'en_US de_DE');` // in you deployer script. set('static_content_locales', 'en_US'); @@ -35,12 +35,14 @@ // Alternatively The themes can be defined as an associative array, where the key represents the theme name and // the key contains the languages for the compilation (for this specific theme). // Examples: -// set('magento_themes', ['Magento/luma']); - Will compile this theme with every language from {{static_content_locales}} +// `set('magento_themes', ['Magento/luma']);` - Will compile this theme with every language from {{static_content_locales}} +// ``` // set('magento_themes', [ // 'Magento/luma' => null, - Will compile all languages from {{static_content_locales}} for Magento/luma // 'Custom/theme' => 'en_US fr_FR' - Will compile only en_US and fr_FR for Custom/theme // 'Custom/another' => '{{static_content_locales}} it_IT' - Will compile all languages from {{static_content_locales}} + it_IT for Custom/another // ]); - Will compile this theme with every language +// ``` set('magento_themes', [ ]); @@ -54,7 +56,7 @@ // Use the default languages for the backend as default set('static_content_locales_backend', '{{static_content_locales}}'); -// backend themes to deploy. Only used if split_static_deployment=true +// backend themes to deploy. Only used if `split_static_deployment=true` // This setting supports the same options/structure as {{magento_themes}} set('magento_themes_backend', ['Magento/backend' => null]); @@ -68,7 +70,7 @@ return time(); }); -// Magento directory relative to repository root. Use '.' (default) if it is not located in a subdirectory +// Magento directory relative to repository root. Use `'.'` (default) if it is not located in a subdirectory set('magento_dir', '.'); @@ -159,7 +161,7 @@ // Tasks -// To work correctly with artifact deployment, it is necessary to set the MAGE_MODE correctly in `app/etc/config.php` +// To work correctly with artifact deployment, it is necessary to set the `MAGE_MODE` correctly in `app/etc/config.php` // e.g. // ```php // 'MAGE_MODE' => 'production' @@ -353,7 +355,7 @@ function magentoDeployAssetsSplit(string $area) // If set to true, the artifact is built from a clean copy of the project repository instead of the current working directory set('build_from_repo', false); -// Set this value if `build_from_repo` is set to true. The target to deploy must also be set with `--branch`, `--tag` or `--revision` +// Set this value if `build_from_repo` is set to `true`. The target to deploy must also be set with `--branch`, `--tag` or `--revision` set('repository', null); // The relative path to the artifact file. If the directory does not exist, it will be created