From 37855fa50007ee7678f2f3de748ed01b197da14c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Nu=C3=9F?= Date: Thu, 29 Sep 2022 14:57:58 +0200 Subject: [PATCH 01/14] Split static content deployment by frontend/backend --- recipe/magento2.php | 71 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 3 deletions(-) diff --git a/recipe/magento2.php b/recipe/magento2.php index 84667bffb..4d97925c1 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -27,6 +27,15 @@ ]); +// Static content deployment options, e.g. '--no-parent' +set('static_deploy_options', ''); + +// Deploy frontend and adminhtml together as default +set('split_static_deployment', false); + +// backend themes to deploy. Only used if split_static_deployment=true +set('magento_themes_backend', ['Magento/backend']); + // Configuration // Also set the number of conccurent jobs to run. The default is 1 @@ -97,17 +106,73 @@ desc('Deploys assets'); task('magento:deploy:assets', function () { - $themesToCompile = ''; - if (count(get('magento_themes')) > 0) { + if (get('split_static_deployment')) { + invoke('magento:deploy:assets:adminhtml'); + invoke('magento:deploy:assets:frontend'); + } elseif (count(get('magento_themes')) > 0 ) { foreach (get('magento_themes') as $theme) { $themesToCompile .= ' -t ' . $theme; } + run("{{bin/php}} {{release_or_current_path}}/bin/magento setup:static-content:deploy --content-version={{content_version}} {{static_deploy_options}} {{static_content_locales}} $themesToCompile -j {{static_content_jobs}}"); } +}); - run("{{bin/php}} {{release_or_current_path}}/bin/magento setup:static-content:deploy --content-version={{content_version}} {{static_content_locales}} $themesToCompile -j {{static_content_jobs}}"); +desc('Deploys assets for backend only'); +task('magento:deploy:assets:adminhtml', function () { + magentoDeployAssetsSplit('backend'); }); +desc('Deploys assets for frontend only'); +task('magento:deploy:assets:frontend', function () { + magentoDeployAssetsSplit('frontend'); +}); + +/** + * @param string $area + * + * @phpstan-param 'frontend'|'backend' $area + * + * @throws \Deployer\Exception\RuntimeException + */ +function magentoDeployAssetsSplit(string $area) +{ + if (!in_array($area, ['frontend', 'backend'], true)) { + throw new \Deployer\Exception\RuntimeException("\$area must be either 'frontend' or 'backend', '$area' given"); + } + + $isFrontend = $area === 'frontend'; + $suffix = $isFrontend + ? '' + : '_backend'; + + $themesConfig = get("magento_themes$suffix"); + $defaultLanguages = get("static_content_locales$suffix"); + $useDefaultLanguages = array_is_list($themesConfig); + + /** @var list $themes */ + $themes = $useDefaultLanguages + ? array_values($themesConfig) + : array_keys($themesConfig); + + $staticContentArea = $isFrontend + ? 'frontend' + : 'adminhtml'; + + if ($useDefaultLanguages) { + $themes = implode('-t ', $themes); + + run("{{bin/php}} {{release_or_current_path}}/bin/magento setup:static-content:deploy --area=$staticContentArea --content-version={{content_version}} {{static_deploy_options}} $defaultLanguages $themes -j {{static_content_jobs}}"); + return; + } + + foreach ($themes as $theme) { + $languages = parse($themesConfig[$theme] ?? $defaultLanguages); + + run("{{bin/php}} {{release_or_current_path}}/bin/magento setup:static-content:deploy --area=$staticContentArea --content-version={{content_version}} {{static_deploy_options}} $languages -t $theme -j {{static_content_jobs}}"); + } +} + desc('Syncs content version'); task('magento:sync:content_version', function () { $timestamp = time(); From c4bbc38df0dc7e91126ab280349646c9ce8a72fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Nu=C3=9F?= Date: Fri, 30 Sep 2022 13:12:03 +0200 Subject: [PATCH 02/14] Use default locales as backend default locales --- recipe/magento2.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipe/magento2.php b/recipe/magento2.php index 4d97925c1..81fd99ae3 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -33,6 +33,9 @@ // Deploy frontend and adminhtml together as default set('split_static_deployment', false); +// Use the defualt 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 set('magento_themes_backend', ['Magento/backend']); From 05e1ad549d285f39b93c546204bb2b3cbf858985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Nu=C3=9F?= Date: Fri, 30 Sep 2022 13:27:29 +0200 Subject: [PATCH 03/14] Add comment to new magento asset compilation variables --- recipe/magento2.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/recipe/magento2.php b/recipe/magento2.php index 81fd99ae3..5051f8519 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -23,6 +23,17 @@ // 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 cna 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}} +// 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', [ ]); @@ -37,6 +48,7 @@ set('static_content_locales_backend', '{{static_content_locales}}'); // 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']); // Configuration From 9416f14c30eb71cb747d6a561835f15d83793232 Mon Sep 17 00:00:00 2001 From: Peter Jaap Blaakmeer Date: Tue, 4 Oct 2022 16:55:15 +0200 Subject: [PATCH 04/14] Typo Co-authored-by: Simon Sprankel --- recipe/magento2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/magento2.php b/recipe/magento2.php index 5051f8519..c7407f9bc 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -44,7 +44,7 @@ // Deploy frontend and adminhtml together as default set('split_static_deployment', false); -// Use the defualt languages for the backend as default +// 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 From 55e9c7c2fffa475774eec596d616426383583cf3 Mon Sep 17 00:00:00 2001 From: Peter Jaap Blaakmeer Date: Tue, 4 Oct 2022 16:55:20 +0200 Subject: [PATCH 05/14] Typo Co-authored-by: Simon Sprankel --- recipe/magento2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/magento2.php b/recipe/magento2.php index c7407f9bc..afe3259a5 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -25,7 +25,7 @@ // 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 cna be defined as an associative array, where the key represents the theme name and +// 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}} From 30d96155a1c3f42eaf9b4df0a9af80c491c95c0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Nu=C3=9F?= Date: Tue, 25 Oct 2022 11:29:42 +0200 Subject: [PATCH 06/14] regenerate docs for m2 --- docs/recipe/magento2.md | 107 ++++++++++++++++++++++++++++++++-------- 1 file changed, 86 insertions(+), 21 deletions(-) diff --git a/docs/recipe/magento2.md b/docs/recipe/magento2.md index ff123ec8e..04a9cd6ec 100644 --- a/docs/recipe/magento2.md +++ b/docs/recipe/magento2.md @@ -68,10 +68,21 @@ in you deployer script. ### magento_themes -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L26) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L37) 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 cna 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) +set('magento_themes', [ + 'Magento/luma' => null, - Will compile all languages from [static_content_locales](/docs/recipe/magento2.md#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 +]); - Will compile this theme with every language ```php title="Default value" [ @@ -80,8 +91,46 @@ all themes - `add('magento_themes', ['Magento/luma', 'Magento/backend']);` ``` +### static_deploy_options +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L42) + +Static content deployment options, e.g. '--no-parent' + + + +### split_static_deployment +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L45) + +Deploy frontend and adminhtml together as default + +```php title="Default value" +false +``` + + +### static_content_locales_backend +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L48) + +Use the defualt languages for the backend as default + +```php title="Default value" +'{{static_content_locales}}' +``` + + +### magento_themes_backend +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L52) + +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" +['Magento/backend'] +``` + + ### static_content_jobs -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L34) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L58) Also set the number of conccurent jobs to run. The default is 1 Update using: `set('static_content_jobs', '1');` @@ -92,7 +141,7 @@ Update using: `set('static_content_jobs', '1');` ### content_version -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L36) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L60) @@ -102,7 +151,7 @@ return time(); ### shared_files -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L40) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L64) Overrides [shared_files](/docs/recipe/deploy/shared.md#shared_files) from `recipe/deploy/shared.php`. @@ -117,7 +166,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#L44) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L68) Overrides [shared_dirs](/docs/recipe/deploy/shared.md#shared_dirs) from `recipe/deploy/shared.php`. @@ -142,7 +191,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#L58) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L82) Overrides [writable_dirs](/docs/recipe/deploy/writable.md#writable_dirs) from `recipe/deploy/writable.php`. @@ -160,7 +209,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#L65) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L89) Overrides [clear_paths](/docs/recipe/deploy/clear_paths.md#clear_paths) from `recipe/deploy/clear_paths.php`. @@ -179,7 +228,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#L74) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L98) @@ -192,7 +241,7 @@ return $matches[0] ?? '2.0'; ### maintenance_mode_status_active -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L81) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L105) @@ -204,7 +253,7 @@ return strpos($maintenanceModeStatusOutput, MAINTENANCE_MODE_ACTIVE_OUTPUT_MSG) ### enable_zerodowntime -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L88) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L112) Deploy without setting maintenance mode if possible @@ -217,7 +266,7 @@ true ## Tasks ### magento:compile -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L92) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L116) Compiles magento di. @@ -225,15 +274,31 @@ Tasks ### magento:deploy:assets -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L99) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L123) Deploys assets. +### magento:deploy:assets:adminhtml +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L137) + +Deploys assets for backend only. + + + + +### magento:deploy:assets:frontend +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L142) + +Deploys assets for frontend only. + + + + ### magento:sync:content_version -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L112) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L192) Syncs content version. @@ -241,7 +306,7 @@ Syncs content version. ### magento:maintenance:enable -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L122) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L202) Enables maintenance mode. @@ -249,7 +314,7 @@ Enables maintenance mode. ### magento:maintenance:disable -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L127) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L207) Disables maintenance mode. @@ -257,7 +322,7 @@ Disables maintenance mode. ### magento:config:import -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L132) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L212) Config Import. @@ -265,7 +330,7 @@ Config Import. ### magento:upgrade:db -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L167) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L247) Upgrades magento database. @@ -273,7 +338,7 @@ Upgrades magento database. ### magento:cache:flush -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L194) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L274) Flushes Magento Cache. @@ -281,7 +346,7 @@ Flushes Magento Cache. ### deploy:magento -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L199) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L279) Magento2 deployment operations. @@ -296,7 +361,7 @@ This task is group task which contains next tasks: ### magento:build -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L207) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L287) Magento2 build operations. @@ -309,7 +374,7 @@ This task is group task which contains next tasks: ### deploy -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L213) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L293) Deploys your project. From b7d6a9a43163cb6ac4ee2dfb3b0a34bc94f17a25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Nu=C3=9F?= Date: Tue, 25 Oct 2022 11:33:19 +0200 Subject: [PATCH 07/14] Change exception to ConfigurationException --- recipe/magento2.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/recipe/magento2.php b/recipe/magento2.php index afe3259a5..005def21b 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -3,6 +3,7 @@ require_once __DIR__ . '/common.php'; +use Deployer\Exception\ConfigurationException; use Deployer\Exception\RunException; use Deployer\Host\Host; @@ -144,16 +145,14 @@ }); /** - * @param string $area - * * @phpstan-param 'frontend'|'backend' $area * - * @throws \Deployer\Exception\RuntimeException + * @throws ConfigurationException */ function magentoDeployAssetsSplit(string $area) { if (!in_array($area, ['frontend', 'backend'], true)) { - throw new \Deployer\Exception\RuntimeException("\$area must be either 'frontend' or 'backend', '$area' given"); + throw new ConfigurationException("\$area must be either 'frontend' or 'backend', '$area' given"); } $isFrontend = $area === 'frontend'; From 7bec2a2f5fac632e9a292f9d8c8b85cfae14ff19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Nu=C3=9F?= Date: Tue, 25 Oct 2022 11:34:52 +0200 Subject: [PATCH 08/14] Add php 8.1 polyfills --- composer.json | 1 + composer.lock | 83 +++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 82 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index c92dc5153..8a8a3bb49 100644 --- a/composer.json +++ b/composer.json @@ -48,6 +48,7 @@ "react/http": "^1.5", "symfony/console": "^5", "symfony/polyfill-php80": "^1.22", + "symfony/polyfill-php81": "^1.26", "symfony/process": "^5", "symfony/yaml": "^5" }, diff --git a/composer.lock b/composer.lock index 5f45ee781..507683509 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "23d858f83416e3f7d060d76320142419", + "content-hash": "81022abe0ce3de12326a19b51217ced3", "packages": [ { "name": "evenement/evenement", @@ -1739,6 +1739,85 @@ ], "time": "2022-03-04T08:16:47+00:00" }, + { + "name": "symfony/polyfill-php81", + "version": "v1.26.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1", + "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-05-24T11:49:31+00:00" + }, { "name": "symfony/process", "version": "v5.4.5", @@ -4815,5 +4894,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } From 7732147abb9c98be2c2418ed3951ca70d8732ffc Mon Sep 17 00:00:00 2001 From: Akos Date: Mon, 6 Mar 2023 11:45:43 +0100 Subject: [PATCH 09/14] set default value for backend --- recipe/magento2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/magento2.php b/recipe/magento2.php index 005def21b..a2f1792d6 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -50,7 +50,7 @@ // 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']); +set('magento_themes_backend', ['Magento/backend' => null]); // Configuration From 0128f75b5dad0a60f5692668dab76f114e8f4f4f Mon Sep 17 00:00:00 2001 From: Akos Date: Mon, 6 Mar 2023 11:46:07 +0100 Subject: [PATCH 10/14] updated theme list --- recipe/magento2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/magento2.php b/recipe/magento2.php index a2f1792d6..567c7ea8f 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -174,7 +174,7 @@ function magentoDeployAssetsSplit(string $area) : 'adminhtml'; if ($useDefaultLanguages) { - $themes = implode('-t ', $themes); + $themes = '-t '.implode(' -t ', $themes); run("{{bin/php}} {{release_or_current_path}}/bin/magento setup:static-content:deploy --area=$staticContentArea --content-version={{content_version}} {{static_deploy_options}} $defaultLanguages $themes -j {{static_content_jobs}}"); return; From 94fb713bdb0ff8573e2d59a0108462510dcf8c15 Mon Sep 17 00:00:00 2001 From: Akos Date: Mon, 6 Mar 2023 15:39:06 +0100 Subject: [PATCH 11/14] added the force option --- recipe/magento2.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipe/magento2.php b/recipe/magento2.php index 567c7ea8f..12391108e 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -176,14 +176,14 @@ function magentoDeployAssetsSplit(string $area) if ($useDefaultLanguages) { $themes = '-t '.implode(' -t ', $themes); - run("{{bin/php}} {{release_or_current_path}}/bin/magento setup:static-content:deploy --area=$staticContentArea --content-version={{content_version}} {{static_deploy_options}} $defaultLanguages $themes -j {{static_content_jobs}}"); + run("{{bin/php}} {{release_or_current_path}}/bin/magento setup:static-content:deploy -f --area=$staticContentArea --content-version={{content_version}} {{static_deploy_options}} $defaultLanguages $themes -j {{static_content_jobs}}"); return; } foreach ($themes as $theme) { $languages = parse($themesConfig[$theme] ?? $defaultLanguages); - run("{{bin/php}} {{release_or_current_path}}/bin/magento setup:static-content:deploy --area=$staticContentArea --content-version={{content_version}} {{static_deploy_options}} $languages -t $theme -j {{static_content_jobs}}"); + run("{{bin/php}} {{release_or_current_path}}/bin/magento setup:static-content:deploy -f --area=$staticContentArea --content-version={{content_version}} {{static_deploy_options}} $languages -t $theme -j {{static_content_jobs}}"); } } From 665f90fe5a16737b55a1a1df9c4313d61488a9a6 Mon Sep 17 00:00:00 2001 From: Akos Date: Mon, 6 Mar 2023 16:41:00 +0100 Subject: [PATCH 12/14] regenerated docs --- docs/recipe/magento2.md | 149 +++++++++++++++++++++++++++++----------- 1 file changed, 107 insertions(+), 42 deletions(-) diff --git a/docs/recipe/magento2.md b/docs/recipe/magento2.md index 09a1d024d..f184c9f1e 100644 --- a/docs/recipe/magento2.md +++ b/docs/recipe/magento2.md @@ -123,10 +123,21 @@ in you deployer script. ### magento_themes -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L29) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L40) 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) +set('magento_themes', [ + 'Magento/luma' => null, - Will compile all languages from [static_content_locales](/docs/recipe/magento2.md#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 +]); - Will compile this theme with every language ```php title="Default value" [ @@ -135,8 +146,46 @@ all themes - `add('magento_themes', ['Magento/luma', 'Magento/backend']);` ``` +### static_deploy_options +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L45) + +Static content deployment options, e.g. '--no-parent' + + + +### split_static_deployment +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L48) + +Deploy frontend and adminhtml together as default + +```php title="Default value" +false +``` + + +### static_content_locales_backend +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L51) + +Use the default languages for the backend as default + +```php title="Default value" +'{{static_content_locales}}' +``` + + +### magento_themes_backend +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L55) + +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" +['Magento/backend' => null] +``` + + ### static_content_jobs -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L37) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L61) Also set the number of conccurent jobs to run. The default is 1 Update using: `set('static_content_jobs', '1');` @@ -147,7 +196,7 @@ Update using: `set('static_content_jobs', '1');` ### content_version -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L39) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L63) @@ -157,7 +206,7 @@ return time(); ### magento_dir -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L44) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L68) Magento directory relative to repository root. Use "." (default) if it is not located in a subdirectory @@ -167,7 +216,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#L47) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L71) Overrides [shared_files](/docs/recipe/deploy/shared.md#shared_files) from `recipe/deploy/shared.php`. @@ -182,7 +231,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#L51) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L75) Overrides [shared_dirs](/docs/recipe/deploy/shared.md#shared_dirs) from `recipe/deploy/shared.php`. @@ -208,7 +257,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#L66) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L90) Overrides [writable_dirs](/docs/recipe/deploy/writable.md#writable_dirs) from `recipe/deploy/writable.php`. @@ -226,7 +275,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#L73) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L97) Overrides [clear_paths](/docs/recipe/deploy/clear_paths.md#clear_paths) from `recipe/deploy/clear_paths.php`. @@ -245,7 +294,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#L82) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L106) @@ -255,7 +304,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#L84) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L108) @@ -268,7 +317,7 @@ return $matches[0] ?? '2.0'; ### maintenance_mode_status_active -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L91) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L115) @@ -280,7 +329,7 @@ return strpos($maintenanceModeStatusOutput, MAINTENANCE_MODE_ACTIVE_OUTPUT_MSG) ### enable_zerodowntime -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L98) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L122) Deploy without setting maintenance mode if possible @@ -290,7 +339,7 @@ true ### artifact_file -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L263) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L341) The file the artifact is saved to @@ -300,7 +349,7 @@ The file the artifact is saved to ### artifact_dir -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L266) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L344) The directory the artifact is saved in @@ -310,7 +359,7 @@ The directory the artifact is saved in ### artifact_excludes_file -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L270) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L348) Points to a file with a list of files to exclude from packaging. The format is as with the `tar --exclude-from=[file]` option @@ -321,7 +370,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#L273) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L351) If set to true, the artifact is built from a clean copy of the project repository instead of the current working directory @@ -331,7 +380,7 @@ false ### repository -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L276) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L354) Overrides [repository](/docs/recipe/common.md#repository) from `recipe/common.php`. @@ -343,7 +392,7 @@ null ### artifact_path -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L279) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L357) The relative path to the artifact file. If the directory does not exist, it will be created @@ -356,7 +405,7 @@ return get('artifact_dir') . '/' . get('artifact_file'); ### bin/tar -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L287) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L365) The location of the tar command. On MacOS you should have installed gtar, as it supports the required settings :::info Autogenerated @@ -367,14 +416,14 @@ The value of this configuration is autogenerated on access. ### additional_shared_files -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L359) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L437) 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#L361) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L439) Array of shared directories that will be added to the default shared_dirs without overriding @@ -384,7 +433,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#L108) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L132) Compiles magento di. @@ -396,7 +445,7 @@ e.g. ### magento:deploy:assets -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L134) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L158) Deploys assets. @@ -422,8 +471,24 @@ in `app/etc/config.php`, e.g.: ``` +### magento:deploy:assets:adminhtml +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L172) + +Deploys assets for backend only. + + + + +### magento:deploy:assets:frontend +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L177) + +Deploys assets for frontend only. + + + + ### magento:sync:content_version -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L147) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L225) Syncs content version. @@ -431,7 +496,7 @@ Syncs content version. ### magento:maintenance:enable -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L157) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L235) Enables maintenance mode. @@ -439,7 +504,7 @@ Enables maintenance mode. ### magento:maintenance:disable -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L163) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L241) Disables maintenance mode. @@ -447,7 +512,7 @@ Disables maintenance mode. ### magento:config:import -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L169) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L247) Config Import. @@ -455,7 +520,7 @@ Config Import. ### magento:upgrade:db -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L204) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L282) Upgrades magento database. @@ -463,7 +528,7 @@ Upgrades magento database. ### magento:cache:flush -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L231) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L309) Flushes Magento Cache. @@ -471,7 +536,7 @@ Flushes Magento Cache. ### deploy:magento -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L236) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L314) Magento2 deployment operations. @@ -486,7 +551,7 @@ This task is group task which contains next tasks: ### magento:build -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L244) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L322) Magento2 build operations. @@ -499,7 +564,7 @@ This task is group task which contains next tasks: ### deploy -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L250) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L328) Deploys your project. @@ -515,7 +580,7 @@ This task is group task which contains next tasks: ### artifact:package -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L298) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L376) Packages all relevant files in an artifact. @@ -523,7 +588,7 @@ Packages all relevant files in an artifact. ### artifact:upload -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L308) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L386) Uploads artifact in release folder for extraction. @@ -531,7 +596,7 @@ Uploads artifact in release folder for extraction. ### artifact:extract -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L313) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L391) Extracts artifact in release path. @@ -539,7 +604,7 @@ Extracts artifact in release path. ### build:remove-generated -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L319) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L397) Clears generated files prior to building. @@ -547,7 +612,7 @@ Clears generated files prior to building. ### build:prepare -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L324) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L402) Prepare local artifact build. @@ -555,7 +620,7 @@ Prepare local artifact build. ### artifact:build -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L349) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L427) Builds an artifact. @@ -572,7 +637,7 @@ This task is group task which contains next tasks: ### deploy:additional-shared -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L365) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L443) Adds additional files and dirs to the list of shared files and dirs. @@ -580,7 +645,7 @@ Adds additional files and dirs to the list of shared files and dirs. ### artifact:prepare -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L372) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L450) Prepares an artifact on the target server. @@ -600,7 +665,7 @@ This task is group task which contains next tasks: ### artifact:finish -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L385) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L463) Executes the tasks after artifact is released. @@ -615,7 +680,7 @@ This task is group task which contains next tasks: ### artifact:deploy -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L393) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L471) Actually releases the artifact deployment. From 0947aa07a8a83b17d46ec56f289b84278cc298e0 Mon Sep 17 00:00:00 2001 From: Akos Date: Mon, 6 Mar 2023 16:55:01 +0100 Subject: [PATCH 13/14] getting the lock file in sync with composer.json --- composer.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.lock b/composer.lock index 0e62e8c5f..3042e95e4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "443f126c4b688aa349d3607009d03a20", + "content-hash": "2e4a876ba583ea7b5ddf4bebd46c0262", "packages": [ { "name": "evenement/evenement", From 23b1af541060a0de1d585ecb6ddcb5832727c370 Mon Sep 17 00:00:00 2001 From: Akos Date: Wed, 8 Mar 2023 10:49:11 +0100 Subject: [PATCH 14/14] regenerated docs --- docs/recipe/magento2.md | 153 ++++++++++++++++++++++++++++------------ 1 file changed, 109 insertions(+), 44 deletions(-) diff --git a/docs/recipe/magento2.md b/docs/recipe/magento2.md index 00d3f0972..5730f7864 100644 --- a/docs/recipe/magento2.md +++ b/docs/recipe/magento2.md @@ -127,10 +127,21 @@ in you deployer script. ### magento_themes -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L29) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L40) 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) +set('magento_themes', [ + 'Magento/luma' => null, - Will compile all languages from [static_content_locales](/docs/recipe/magento2.md#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 +]); - Will compile this theme with every language ```php title="Default value" [ @@ -139,8 +150,46 @@ all themes - `add('magento_themes', ['Magento/luma', 'Magento/backend']);` ``` +### static_deploy_options +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L45) + +Static content deployment options, e.g. '--no-parent' + + + +### split_static_deployment +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L48) + +Deploy frontend and adminhtml together as default + +```php title="Default value" +false +``` + + +### static_content_locales_backend +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L51) + +Use the default languages for the backend as default + +```php title="Default value" +'{{static_content_locales}}' +``` + + +### magento_themes_backend +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L55) + +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" +['Magento/backend' => null] +``` + + ### static_content_jobs -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L37) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L61) Also set the number of conccurent jobs to run. The default is 1 Update using: `set('static_content_jobs', '1');` @@ -151,7 +200,7 @@ Update using: `set('static_content_jobs', '1');` ### content_version -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L39) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L63) @@ -161,7 +210,7 @@ return time(); ### magento_dir -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L44) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L68) Magento directory relative to repository root. Use "." (default) if it is not located in a subdirectory @@ -171,7 +220,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#L47) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L71) Overrides [shared_files](/docs/recipe/deploy/shared.md#shared_files) from `recipe/deploy/shared.php`. @@ -186,7 +235,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#L51) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L75) Overrides [shared_dirs](/docs/recipe/deploy/shared.md#shared_dirs) from `recipe/deploy/shared.php`. @@ -212,7 +261,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#L66) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L90) Overrides [writable_dirs](/docs/recipe/deploy/writable.md#writable_dirs) from `recipe/deploy/writable.php`. @@ -230,7 +279,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#L73) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L97) Overrides [clear_paths](/docs/recipe/deploy/clear_paths.md#clear_paths) from `recipe/deploy/clear_paths.php`. @@ -249,7 +298,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#L82) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L106) @@ -259,7 +308,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#L84) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L108) @@ -272,7 +321,7 @@ return $matches[0] ?? '2.0'; ### config_import_needed -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L91) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L115) :::info Autogenerated @@ -283,7 +332,7 @@ The value of this configuration is autogenerated on access. ### database_upgrade_needed -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L105) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L129) :::info Autogenerated @@ -294,7 +343,7 @@ The value of this configuration is autogenerated on access. ### enable_zerodowntime -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L120) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L144) Deploy without setting maintenance mode if possible @@ -304,7 +353,7 @@ true ### artifact_file -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L250) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L328) The file the artifact is saved to @@ -314,7 +363,7 @@ The file the artifact is saved to ### artifact_dir -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L253) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L331) The directory the artifact is saved in @@ -324,7 +373,7 @@ The directory the artifact is saved in ### artifact_excludes_file -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L257) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L335) Points to a file with a list of files to exclude from packaging. The format is as with the `tar --exclude-from=[file]` option @@ -335,7 +384,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#L260) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L338) If set to true, the artifact is built from a clean copy of the project repository instead of the current working directory @@ -345,7 +394,7 @@ false ### repository -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L263) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L341) Overrides [repository](/docs/recipe/common.md#repository) from `recipe/common.php`. @@ -357,7 +406,7 @@ null ### artifact_path -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L266) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L344) The relative path to the artifact file. If the directory does not exist, it will be created @@ -370,7 +419,7 @@ return get('artifact_dir') . '/' . get('artifact_file'); ### bin/tar -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L274) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L352) The location of the tar command. On MacOS you should have installed gtar, as it supports the required settings :::info Autogenerated @@ -381,14 +430,14 @@ The value of this configuration is autogenerated on access. ### additional_shared_files -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L346) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L424) 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#L348) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L426) Array of shared directories that will be added to the default shared_dirs without overriding @@ -398,7 +447,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#L130) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L154) Compiles magento di. @@ -410,7 +459,7 @@ e.g. ### magento:deploy:assets -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L156) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L180) Deploys assets. @@ -436,8 +485,24 @@ in `app/etc/config.php`, e.g.: ``` +### magento:deploy:assets:adminhtml +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L194) + +Deploys assets for backend only. + + + + +### magento:deploy:assets:frontend +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L199) + +Deploys assets for frontend only. + + + + ### magento:sync:content_version -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L169) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L247) Syncs content version. @@ -445,7 +510,7 @@ Syncs content version. ### magento:maintenance:enable -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L179) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L257) Enables maintenance mode. @@ -453,7 +518,7 @@ Enables maintenance mode. ### magento:maintenance:disable -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L185) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L263) Disables maintenance mode. @@ -461,7 +526,7 @@ Disables maintenance mode. ### magento:maintenance:enable-if-needed -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L191) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L269) Set maintenance mode if needed. @@ -469,7 +534,7 @@ Set maintenance mode if needed. ### magento:config:import -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L198) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L276) Config Import. @@ -477,7 +542,7 @@ Config Import. ### magento:upgrade:db -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L207) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L285) Upgrades magento database. @@ -485,7 +550,7 @@ Upgrades magento database. ### magento:cache:flush -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L216) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L294) Flushes Magento Cache. @@ -493,7 +558,7 @@ Flushes Magento Cache. ### deploy:magento -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L221) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L299) Magento2 deployment operations. @@ -510,7 +575,7 @@ This task is group task which contains next tasks: ### magento:build -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L231) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L309) Magento2 build operations. @@ -523,7 +588,7 @@ This task is group task which contains next tasks: ### deploy -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L237) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L315) Deploys your project. @@ -539,7 +604,7 @@ This task is group task which contains next tasks: ### artifact:package -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L285) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L363) Packages all relevant files in an artifact. @@ -547,7 +612,7 @@ Packages all relevant files in an artifact. ### artifact:upload -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L295) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L373) Uploads artifact in release folder for extraction. @@ -555,7 +620,7 @@ Uploads artifact in release folder for extraction. ### artifact:extract -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L300) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L378) Extracts artifact in release path. @@ -563,7 +628,7 @@ Extracts artifact in release path. ### build:remove-generated -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L306) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L384) Clears generated files prior to building. @@ -571,7 +636,7 @@ Clears generated files prior to building. ### build:prepare -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L311) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L389) Prepare local artifact build. @@ -579,7 +644,7 @@ Prepare local artifact build. ### artifact:build -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L336) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L414) Builds an artifact. @@ -596,7 +661,7 @@ This task is group task which contains next tasks: ### deploy:additional-shared -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L352) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L430) Adds additional files and dirs to the list of shared files and dirs. @@ -604,7 +669,7 @@ Adds additional files and dirs to the list of shared files and dirs. ### artifact:prepare -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L359) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L437) Prepares an artifact on the target server. @@ -624,7 +689,7 @@ This task is group task which contains next tasks: ### artifact:finish -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L372) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L450) Executes the tasks after artifact is released. @@ -639,7 +704,7 @@ This task is group task which contains next tasks: ### artifact:deploy -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L380) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L458) Actually releases the artifact deployment.