Skip to content

Commit

Permalink
Merge branch 'master' into docs(recipe/shopware)-add-code-syntax-high…
Browse files Browse the repository at this point in the history
…lighting
  • Loading branch information
SimJoSt authored May 17, 2024
2 parents 93ac22a + 1d3c166 commit 71c62f5
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 44 deletions.
72 changes: 36 additions & 36 deletions docs/recipe/magento2.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,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)

Also set the number of conccurent jobs to run. The default is 1
Also set the number of concurrent jobs to run. The default is 1
Update using: `set('static_content_jobs', '1');`

```php title="Default value"
Expand Down Expand Up @@ -353,7 +353,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#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#L346)
[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#L350)
[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#L353)
[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#L356)
[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#L359)
[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#L367)
[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#L439)
[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#L441)
[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#L309)
[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#L314)
[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#L324)
[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#L330)
[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#L378)
[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#L388)
[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#L393)
[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#L399)
[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#L404)
[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#L429)
[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#L445)
[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#L460)
[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#L500)
[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#L516)
[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#L532)
[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#L538)
[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#L551)
[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#L560)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L562)

Actually releases the artifact deployment.

Expand Down
12 changes: 7 additions & 5 deletions recipe/magento2.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

// Configuration

// Also set the number of conccurent jobs to run. The default is 1
// Also set the number of concurrent jobs to run. The default is 1
// Update using: `set('static_content_jobs', '1');`
set('static_content_jobs', '1');

Expand Down 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 Expand Up @@ -299,11 +300,12 @@ function magentoDeployAssetsSplit(string $area)
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");
run("{{bin/php}} {{bin/magento}} setup:db-schema:upgrade --no-interaction");
run("{{bin/php}} {{bin/magento}} setup:db-data:upgrade --no-interaction");
} else {
writeln('Database schema is up to date => upgrade skipped');
}
});
})->once();

desc('Flushes Magento Cache');
task('magento:cache:flush', function () {
Expand Down
10 changes: 10 additions & 0 deletions recipe/shopware.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,16 @@ function getPlugins(): array
'deploy:publish',
]);

task('deploy:update_code')->setCallback(static function () {
upload('.', '{{release_path}}', [
'options' => [
'--exclude=.git',
'--exclude=deploy.php',
'--exclude=node_modules',
],
]);
});

task('sw-build-without-db:get-remote-config', static function () {
if (!test('[ -d {{current_path}} ]')) {
return;
Expand Down
Loading

0 comments on commit 71c62f5

Please sign in to comment.