docs/recipe/shopware.md
require 'recipe/shopware.php';
Deployer is a free and open source deployment tool written in PHP. It helps you to deploy your Shopware application to a server. It is very easy to use and has a lot of features.
Three main features of Deployer are:
Additionally, Deployer has a lot of other features, like:
You can read more about Deployer in Getting Started.
The deploy task of Shopware consists of:
The shopware recipe is based on the common recipe.
Add repository to your deploy.php file:
set('repository', '[email protected]:shopware/production.git');
configure host:
host('SSH-HOSTNAME')
->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, the web server 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 build without database. :::
'{{bin/php}} {{release_or_current_path}}/bin/console'
Overrides default_timeout from recipe/common.php.
Overrides shared_files from recipe/deploy/shared.php.
These files are shared among all releases.
[
'.env.local',
'install.lock',
'public/.htaccess',
'public/.user.ini',
]
Overrides shared_dirs from recipe/deploy/shared.php.
These directories are shared among all releases.
[
'config/jwt',
'files',
'var/log',
'public/media',
'public/plugins',
'public/thumbnail',
'public/sitemap',
]
Overrides writable_dirs from recipe/deploy/writable.php.
These directories are made writable (the definition of "writable" requires attention).
Please note that the files in config/jwt/* receive special attention in the sw:writable:jwt task.
[
'config/jwt',
'custom/plugins',
'files',
'public/bundles',
'public/css',
'public/fonts',
'public/js',
'public/media',
'public/plugins',
'public/sitemap',
'public/theme',
'public/thumbnail',
'var',
]
This sets the Shopware version to the version of the Shopware console command.
$versionOutput = run('cd {{release_path}} && {{bin/console}} -V');
preg_match('/(\d+\.\d+\.\d+\.\d+)/', $versionOutput, $matches);
return $matches[0] ?? '6.6.0';
This task remotely executes the cache:clear console command on the target server.
This task remotely executes the cache warmup console commands on the target server, so that the first user, who visits the website, doesn't have to wait for the cache to be built up.
This task remotely executes the database:migrate console command on the target server.
This task is not used by default, but can be used, e.g. in combination with SHOPWARE_SKIP_THEME_COMPILE=1,
to build the theme remotely instead of locally.
Grouped SW deploy tasks.
This task is group task which contains next tasks:
Deploys your project.
This task is group task which contains next tasks:
This task is group task which contains next tasks: