diff --git a/docs/recipe/magento2.md b/docs/recipe/magento2.md index eb06bf245..0ee43ec4f 100644 --- a/docs/recipe/magento2.md +++ b/docs/recipe/magento2.md @@ -353,7 +353,7 @@ true ### artifact_file -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L345) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L354) The file the artifact is saved to @@ -363,7 +363,7 @@ The file the artifact is saved to ### artifact_dir -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L348) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L357) The directory the artifact is saved in @@ -373,7 +373,7 @@ The directory the artifact is saved in ### artifact_excludes_file -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L352) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L361) 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 +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#L355) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L364) If set to true, the artifact is built from a clean copy of the project repository instead of the current working directory @@ -394,7 +394,7 @@ false ### repository -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L358) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L367) Overrides [repository](/docs/recipe/common.md#repository) from `recipe/common.php`. @@ -406,7 +406,7 @@ null ### artifact_path -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L361) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L370) The relative path to the artifact file. If the directory does not exist, it will be created @@ -419,7 +419,7 @@ return get('artifact_dir') . '/' . get('artifact_file'); ### bin/tar -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L369) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L378) The location of the tar command. On MacOS you should have installed gtar, as it supports the required settings :::info Autogenerated @@ -430,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#L441) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L450) 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#L443) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L452) Array of shared directories that will be added to the default shared_dirs without overriding @@ -510,7 +510,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#L282) Enables maintenance mode. @@ -518,7 +518,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#L288) Disables maintenance mode. @@ -526,7 +526,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#L294) Set maintenance mode if needed. @@ -534,7 +534,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#L301) Config Import. @@ -542,7 +542,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#L310) Upgrades magento database. @@ -550,7 +550,7 @@ Upgrades magento database. ### magento:cache:flush -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L311) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L320) Flushes Magento Cache. @@ -558,7 +558,7 @@ Flushes Magento Cache. ### deploy:magento -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L316) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L325) Magento2 deployment operations. @@ -575,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#L326) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L335) Magento2 build operations. @@ -588,7 +588,7 @@ This task is group task which contains next tasks: ### deploy -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L332) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L341) Deploys your project. @@ -604,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#L380) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L389) Packages all relevant files in an artifact. @@ -612,7 +612,7 @@ Packages all relevant files in an artifact. ### artifact:upload -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L390) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L399) Uploads artifact in release folder for extraction. @@ -620,7 +620,7 @@ Uploads artifact in release folder for extraction. ### artifact:extract -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L395) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L404) Extracts artifact in release path. @@ -628,7 +628,7 @@ Extracts artifact in release path. ### build:remove-generated -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L401) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L410) Clears generated files prior to building. @@ -636,7 +636,7 @@ Clears generated files prior to building. ### build:prepare -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L406) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L415) Prepare local artifact build. @@ -644,7 +644,7 @@ Prepare local artifact build. ### artifact:build -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L431) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L440) Builds an artifact. @@ -661,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#L447) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L456) Adds additional files and dirs to the list of shared files and dirs. @@ -669,7 +669,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#L462) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L471) Update cache id_prefix. @@ -683,7 +683,7 @@ after('deploy:magento', 'magento:cleanup_cache_prefix'); ### magento:cleanup_cache_prefix -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L502) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L511) Cleanup cache id_prefix env files. @@ -691,7 +691,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#L518) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L527) Remove cron from crontab and kill running cron jobs. @@ -703,7 +703,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#L534) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L543) Install cron in crontab. @@ -715,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#L540) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L549) Prepares an artifact on the target server. @@ -735,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#L553) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L562) Executes the tasks after artifact is released. @@ -750,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#L562) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L571) Actually releases the artifact deployment. diff --git a/recipe/magento2.php b/recipe/magento2.php index 0e681e7c7..d5ea956ec 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -202,7 +202,7 @@ $themesToCompile .= ' -t ' . $theme; } } - run("{{bin/php}} {{release_or_current_path}}/bin/magento setup:static-content:deploy -f --content-version={{content_version}} {{static_deploy_options}} {{static_content_locales}} $themesToCompile -j {{static_content_jobs}}"); + run("{{bin/php}} {{release_or_current_path}}/{{magento_dir}}/bin/magento setup:static-content:deploy -f --content-version={{content_version}} {{static_deploy_options}} {{static_content_locales}} $themesToCompile -j {{static_content_jobs}}"); } }); @@ -269,6 +269,15 @@ function magentoDeployAssetsSplit(string $area) before('magento:deploy:assets', 'magento:sync:content_version'); +before('deploy:vendors', function(){ + set('original_release_or_current_path',get('release_or_current_path')); + set('release_or_current_path', get('release_or_current_path') .'/'. get('magento_dir')); +}); + +after('deploy:vendors', function (){ + set('release_or_current_path', get('original_release_or_current_path')); +}); + desc('Enables maintenance mode'); task('magento:maintenance:enable', function () { // do not use {{bin/magento}} because it would be in "release" but the maintenance mode must be set in "current"