diff --git a/docs/recipe/magento2.md b/docs/recipe/magento2.md index 7e83e7801..efa85b478 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 @@ -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,21 +127,24 @@ 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#L46) 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: -set('magento_themes', ['Magento/luma']); - Will compile this theme with every language from [static_content_locales](/docs/recipe/magento2.md#static_content_locales) +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 + '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" [ @@ -151,14 +154,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#L51) -Static content deployment options, e.g. '--no-parent' +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#L54) Deploy frontend and adminhtml together as default @@ -168,7 +171,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#L57) Use the default languages for the backend as default @@ -178,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#L58) +[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" @@ -189,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#L64) +[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');` @@ -200,7 +203,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#L69) @@ -210,9 +213,9 @@ 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#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" '.' @@ -220,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#L74) +[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`. @@ -235,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#L78) +[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`. @@ -261,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#L93) +[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`. @@ -279,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#L100) +[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`. @@ -298,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#L109) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L112) @@ -308,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#L111) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L114) @@ -321,7 +324,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#L121) :::info Autogenerated @@ -332,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#L132) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L135) :::info Autogenerated @@ -343,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#L157) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L160) Deploy without setting maintenance mode if possible @@ -353,7 +356,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#L346) The file the artifact is saved to @@ -363,7 +366,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#L349) The directory the artifact is saved in @@ -373,7 +376,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#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 @@ -384,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#L353) +[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 @@ -394,11 +397,11 @@ 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#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 @@ -406,7 +409,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#L362) The relative path to the artifact file. If the directory does not exist, it will be created @@ -419,7 +422,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#L370) The location of the tar command. On MacOS you should have installed gtar, as it supports the required settings :::info Autogenerated @@ -430,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#L439) +[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#L441) +[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 @@ -447,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#L167) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L170) -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` +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' @@ -459,7 +462,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#L196) Deploys assets. @@ -486,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#L209) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L212) Deploys assets for backend only. @@ -494,7 +497,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#L217) Deploys assets for frontend only. @@ -502,7 +505,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#L265) Syncs content version. @@ -510,7 +513,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#L275) Enables maintenance mode. @@ -518,7 +521,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#L281) Disables maintenance mode. @@ -526,7 +529,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#L287) Set maintenance mode if needed. @@ -534,7 +537,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#L294) Config Import. @@ -542,15 +545,15 @@ 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#L303) -Upgrades magento database. +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#L312) Flushes Magento Cache. @@ -558,7 +561,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#L317) Magento2 deployment operations. @@ -575,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#L324) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L327) Magento2 build operations. @@ -588,7 +591,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#L333) Deploys your project. @@ -604,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#L378) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L381) Packages all relevant files in an artifact. @@ -612,7 +615,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#L391) Uploads artifact in release folder for extraction. @@ -620,7 +623,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#L396) Extracts artifact in release path. @@ -628,7 +631,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#L402) Clears generated files prior to building. @@ -636,7 +639,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#L407) Prepare local artifact build. @@ -644,7 +647,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#L432) Builds an artifact. @@ -661,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#L445) +[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. @@ -669,12 +672,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#L463) 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,15 +686,15 @@ 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#L503) 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 -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L516) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L519) Remove cron from crontab and kill running cron jobs. @@ -703,11 +706,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#L532) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L534) 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'); @@ -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 fdfe6d24f..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'); @@ -29,22 +29,25 @@ // 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: -// set('magento_themes', ['Magento/luma']); - Will compile this theme with every language from {{static_content_locales}} +// 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 // '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', [ ]); -// 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 @@ -53,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]); @@ -67,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', '.'); @@ -158,12 +161,12 @@ // 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' // ``` -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'); @@ -296,7 +299,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"); @@ -352,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 @@ -448,8 +451,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'); @@ -494,7 +497,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 () { @@ -522,7 +525,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');