Skip to content

Commit

Permalink
Improve recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
UlrichThomasGabor authored Oct 24, 2023
1 parent 003b4e5 commit 7f905c2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
34 changes: 18 additions & 16 deletions docs/recipe/shopware.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,18 @@ You can read more about Deployer in [Getting Started](/docs/getting-started.md).

The [deploy](#deploy) task of **Shopware** consists of:
* [deploy:prepare](/docs/recipe/common.md#deployprepare) – Prepares a new release
* [deploy:info](/docs/recipe/typo3.md#deployinfo)
* [deploy:info](/docs/recipe/deploy/info.md#deployinfo)Displays info about deployment
* [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/typo3.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
* [sw:deploy](/docs/recipe/shopware.md#swdeploy)
* [sw:database:migrate](/docs/recipe/shopware.md#swdatabasemigrate)
* [sw:plugin:refresh](/docs/recipe/shopware.md#swpluginrefresh)
* [sw:theme:refresh](/docs/recipe/shopware.md#swthemerefresh)
* [sw:scheduled-task:register](/docs/recipe/shopware.md#swscheduled-taskregister)
* [sw:theme:compile](/docs/recipe/shopware.md#swthemecompile)
* [sw:cache:clear](/docs/recipe/shopware.md#swcacheclear)
* [sw:plugin:update:all](/docs/recipe/shopware.md#swpluginupdateall)
* [sw:cache:clear](/docs/recipe/shopware.md#swcacheclear)
Expand All @@ -68,10 +67,13 @@ set('repository', '[email protected]:shopware/production.git');

configure host:
host('SSH-HOSTNAME')
->setRemoteUser('SSH-USER')
->set('remote_user', 'SSH-USER')
->set('deploy_path', '/var/www/shopware') // This is the path, where deployer will create its directory structure
->set('http_user', 'www-data') // Not needed, if the `user` is the same user, the webserver is running with
->set('writable_mode', 'chmod');
->set('http_user', 'www-data') // Not needed, if the `user` is the same user, the webserver is running with
->set('http_group', 'www-data')
->set('writable_mode', 'chmod')
->set('writable_recursive', true)
->set('become', 'www-data'); // You might want to change user to execute remote tasks because of access rights of created cache files

:::note
Please remember that the installation must be modified so that it can be
Expand All @@ -81,7 +83,7 @@ Please remember that the installation must be modified so that it can be

## Configuration
### bin/console
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L30)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L32)



Expand All @@ -91,7 +93,7 @@ Please remember that the installation must be modified so that it can be


### default_timeout
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L32)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L34)

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

Expand Down Expand Up @@ -214,43 +216,43 @@ This task remotely executes the `database:migrate` console command on the target


### sw:theme:compile
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L100)

[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L102)



This task is not used per default, but can be used, e.g. in combination with `SHOPWARE_SKIP_THEME_COMPILE=1`,
to build the theme remotely instead of locally.


### sw:plugin:update:all
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L136)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L138)






### sw:writable:jwt
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L146)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L148)






### sw:deploy
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L154)

[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L155)



Grouped SW deploy tasks.


This task is group task which contains next tasks:
* [sw:database:migrate](/docs/recipe/shopware.md#swdatabasemigrate)
* [sw:plugin:refresh](/docs/recipe/shopware.md#swpluginrefresh)
* [sw:theme:refresh](/docs/recipe/shopware.md#swthemerefresh)
* [sw:scheduled-task:register](/docs/recipe/shopware.md#swscheduled-taskregister)
* [sw:theme:compile](/docs/recipe/shopware.md#swthemecompile)
* [sw:cache:clear](/docs/recipe/shopware.md#swcacheclear)
* [sw:plugin:update:all](/docs/recipe/shopware.md#swpluginupdateall)
* [sw:cache:clear](/docs/recipe/shopware.md#swcacheclear)
Expand Down Expand Up @@ -290,7 +292,7 @@ This task is group task which contains next tasks:


### sw-build-without-db
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L193)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L192)



Expand Down
19 changes: 9 additions & 10 deletions recipe/shopware.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
*
* configure host:
* host('SSH-HOSTNAME')
* ->setRemoteUser('SSH-USER')
* ->set('remote_user', 'SSH-USER')
* ->set('deploy_path', '/var/www/shopware') // This is the path, where deployer will create its directory structure
* ->set('http_user', 'www-data') // Not needed, if the `user` is the same user, the webserver is running with
* ->set('writable_mode', 'chmod');
* ->set('http_user', 'www-data') // Not needed, if the `user` is the same user, the webserver is running with
* ->set('http_group', 'www-data')
* ->set('writable_mode', 'chmod')
* ->set('writable_recursive', true)
* ->set('become', 'www-data'); // You might want to change user to execute remote tasks because of access rights of created cache files
*
* :::note
* Please remember that the installation must be modified so that it can be
Expand All @@ -22,7 +25,6 @@
*/
namespace Deployer;


require_once __DIR__ . '/common.php';

add('recipes', ['shopware']);
Expand All @@ -31,8 +33,6 @@

set('default_timeout', 3600); // Increase when tasks take longer than that.

//set host configuration and repository here

// These files are shared among all releases.
set('shared_files', [
'.env',
Expand Down Expand Up @@ -97,6 +97,8 @@
run('cd {{release_path}} && {{bin/console}} theme:refresh');
});

// This task is not used per default, but can be used, e.g. in combination with `SHOPWARE_SKIP_THEME_COMPILE=1`,
// to build the theme remotely instead of locally.
task('sw:theme:compile', function () {
run('cd {{release_path}} && {{bin/console}} theme:compile');
});
Expand Down Expand Up @@ -150,13 +152,11 @@ function getPlugins(): array
/**
* Grouped SW deploy tasks.
*/

task('sw:deploy', [
'sw:database:migrate',
'sw:plugin:refresh',
'sw:theme:refresh',
'sw:scheduled-task:register',
'sw:theme:compile',
'sw:cache:clear',
'sw:plugin:update:all',
'sw:cache:clear',
Expand Down Expand Up @@ -186,10 +186,9 @@ function getPlugins(): array
});

task('sw-build-without-db:build', static function () {
runLocally('CI=1 SHOPWARE_SKIP_BUNDLE_DUMP=1 SHOPWARE_SKIP_THEME_COMPILE=1 bin/build-js.sh');
runLocally('CI=1 SHOPWARE_SKIP_BUNDLE_DUMP=1 ./bin/build-js.sh');
});


task('sw-build-without-db', [
'sw-build-without-db:get-remote-config',
'sw-build-without-db:build',
Expand Down

0 comments on commit 7f905c2

Please sign in to comment.