This repository contains a deployer configuration for Shopware 6.
Copy the entire .deployment
directory from the example
directory of this repository into your project and modify it to suit your needs.
Use .gitlab-ci.yml
as an example and/or adapt it to your ci syntax.
- We assume that the
js
files will be built in CI and published to the deployment jobs via artifacts. - We assume that your shop is prepared for compilation without a database in CI. For more information, see here.
- We assume that all plugins are required via composer (custom plugins are placed in
custom/static-plugins
).
cachetool
=> Needs to be the path of your php socket - if you want to usecachetool:clear:opcache
in the deployment stepsdeploy_path
=> The path where the deployment should be setup on the serveruser
&hostname
should be changed according to your data
app_url
=> Should be the main domain/url of your shopbranch
=> Should be the target branch which is used for the deployment stepstage
=> Should be the specific stage of the deploymentport
=> If your ssh port is not22
you have to adjust this
plugins
=> Should contain a list of plugins which are automatically installed and activated (eg. managed by deployment)source_directory
=> Needs to be the path of your project root on the server
keep_releases
=> Defines the number of previous releases which are kept on the serverapplication
=> Change this value to your project namersync
=> You might want to adjust the ignored files according to your project setup and file structure
shopware6:plugins:install_update
- Handles the installation, update and activation of plugins defined in the
plugins
section of thedeploy.php
- Handles the installation, update and activation of plugins defined in the
shopware6:update
- Executes the
system:update:prepare
andsystem:update:finish
command of Shopware
- Executes the
shopware6:messenger:stop
- Executes
messenger:stop-workers
to reset workers- This requires the workers to be started automatically, e.g. via
supervisord
- This requires the workers to be started automatically, e.g. via
- Executes
shopware6:bundle:dump
- Executes
bundle:dump
and is needed to publish the prebuildjs
files
- Executes
shopware6:theme:compile
- Will execute the
theme:compile
command - Can be used if the theme compilation doesn't happen during the
ci
process
- Will execute the
-
You should compile your js/scss files during your ci runtime
-
Composer installs/updates/requirements should be done before the deployment starts
-
deployer
will create several directories in your deployment path on the server:.dep
: Information about the releasescurrent
: Symlink that will always be linked to the latest release. Use it for your document root.releases
: This directory contains the last 5 releases. If you want to keep more or less releases, simply overwrite thekeep_releases
setting as stated above.shared/
: Here you can add additional files that will persist between deployments (like the already shared.env
or.htaccess
)
Feel free to send pull requests if you have any optimizations. They will be highly appreciated.
MIT licensed, see LICENSE