Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

magento2 theme processing fix for 3786 #3818

Merged
merged 10 commits into from
Apr 24, 2024
72 changes: 36 additions & 36 deletions docs/recipe/magento2.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The [deploy](#deploy) task of **Magento 2** consists of:
* [deploy:setup](/docs/recipe/deploy/setup.md#deploysetup) – Prepares host for deploy
* [deploy:lock](/docs/recipe/deploy/lock.md#deploylock) – Locks deploy
* [deploy:release](/docs/recipe/deploy/release.md#deployrelease) – Prepares release
* [deploy:update_code](/docs/recipe/shopware.md#deployupdate_code) –
* [deploy:update_code](/docs/recipe/deploy/update_code.md#deployupdate_code) – Updates code
* [deploy:shared](/docs/recipe/deploy/shared.md#deployshared) – Creates symlinks for shared files and dirs
* [deploy:writable](/docs/recipe/deploy/writable.md#deploywritable) – Makes writable dirs
* [deploy:vendors](/docs/recipe/deploy/vendors.md#deployvendors) – Installs vendors
Expand Down Expand Up @@ -353,7 +353,7 @@ true


### artifact_file
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L344)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L345)

The file the artifact is saved to

Expand All @@ -363,7 +363,7 @@ The file the artifact is saved to


### artifact_dir
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L347)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L348)

The directory the artifact is saved in

Expand All @@ -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#L351)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L352)

Points to a file with a list of files to exclude from packaging.
The format is as with the `tar --exclude-from=[file]` option
Expand All @@ -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#L354)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L355)

If set to true, the artifact is built from a clean copy of the project repository instead of the current working directory

Expand All @@ -394,7 +394,7 @@ false


### repository
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L357)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L358)

Overrides [repository](/docs/recipe/common.md#repository) from `recipe/common.php`.

Expand All @@ -406,7 +406,7 @@ null


### artifact_path
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L360)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L361)

The relative path to the artifact file. If the directory does not exist, it will be created

Expand All @@ -419,7 +419,7 @@ return get('artifact_dir') . '/' . get('artifact_file');


### bin/tar
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L368)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L369)

The location of the tar command. On MacOS you should have installed gtar, as it supports the required settings
:::info Autogenerated
Expand All @@ -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#L440)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L441)

Array of shared files that will be added to the default shared_files without overriding



### additional_shared_dirs
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L442)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L443)

Array of shared directories that will be added to the default shared_dirs without overriding

Expand Down Expand Up @@ -486,79 +486,79 @@ in `app/etc/config.php`, e.g.:


### magento:deploy:assets:adminhtml
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L209)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L210)

Deploys assets for backend only.




### magento:deploy:assets:frontend
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L214)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L215)

Deploys assets for frontend only.




### magento:sync:content_version
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L262)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L263)

Syncs content version.




### magento:maintenance:enable
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L272)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L273)

Enables maintenance mode.




### magento:maintenance:disable
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L278)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L279)

Disables maintenance mode.




### magento:maintenance:enable-if-needed
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L284)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L285)

Set maintenance mode if needed.




### magento:config:import
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L291)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L292)

Config Import.




### magento:upgrade:db
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L300)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L301)

Upgrades magento database.




### magento:cache:flush
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L310)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L311)

Flushes Magento Cache.




### deploy:magento
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L315)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L316)

Magento2 deployment operations.

Expand All @@ -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#L325)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L326)

Magento2 build operations.

Expand All @@ -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#L331)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L332)

Deploys your project.

Expand All @@ -604,47 +604,47 @@ This task is group task which contains next tasks:


### artifact:package
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L379)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L380)

Packages all relevant files in an artifact.




### artifact:upload
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L389)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L390)

Uploads artifact in release folder for extraction.




### artifact:extract
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L394)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L395)

Extracts artifact in release path.




### build:remove-generated
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L400)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L401)

Clears generated files prior to building.




### build:prepare
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L405)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L406)

Prepare local artifact build.




### artifact:build
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L430)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L431)

Builds an artifact.

Expand All @@ -661,15 +661,15 @@ This task is group task which contains next tasks:


### deploy:additional-shared
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L446)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L447)

Adds additional files and dirs to the list of shared files and dirs.




### magento:set_cache_prefix
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L461)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L462)

Update cache id_prefix.

Expand All @@ -683,15 +683,15 @@ after('deploy:magento', 'magento:cleanup_cache_prefix');


### magento:cleanup_cache_prefix
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L501)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L502)

Cleanup cache id_prefix env files.

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#L517)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L518)

Remove cron from crontab and kill running cron jobs.

Expand All @@ -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#L533)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L534)

Install cron in crontab.

Expand All @@ -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#L539)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L540)

Prepares an artifact on the target server.

Expand All @@ -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#L552)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L553)

Executes the tasks after artifact is released.

Expand All @@ -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#L561)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L562)

Actually releases the artifact deployment.

Expand Down
5 changes: 3 additions & 2 deletions recipe/magento2.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,12 @@
invoke('magento:deploy:assets:frontend');
} else {
if (count(get('magento_themes')) > 0 ) {
foreach (get('magento_themes') as $theme) {
$themes = array_is_list(get('magento_themes')) ? get('magento_themes') : array_keys(get('magento_themes'));
foreach ($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 -f --content-version={{content_version}} {{static_deploy_options}} {{static_content_locales}} $themesToCompile -j {{static_content_jobs}}");
}
});

Expand Down
Loading