While developing the Official Shopware Docker Image, we tried to simplify the deployment tasks required to get a shop running. This simplification led to a set of shell scripts designed explicitly for Docker. With the Deployment Helper, we created a better general approach that fits into every deployment method. The Deployment Helper is a standalone Symfony Application that can be installed in your Shopware Installation.
So you can install it regularly with Composer:
and can be used with vendor/bin/shopware-deployment-helper run
Functional overview of the Deployment Helper
The Deployment Helper automates several tasks within Shopware Deployment. Its primary functions include:
Shopware installation and update: The tool verifies the presence of an existing Shopware installation. If Shopware is not detected, the Deployment Helper initiates an automated installation process. Conversely, if an installation is present, it triggers the necessary update procedures, including executing database migrations and performing other required update tasks.
Plugin and app management: The Deployment Helper automates the installation of all designated plugins and apps, ensuring a consistent and comprehensive application environment.
Shopware Store authentication: It facilitates seamless authentication by logging the Shopware Instance into the Shopware Store.
Fastly CDN configuration: The tool automates the configuration of Fastly's Content Delivery Network (CDN) settings, optimizing content delivery and application performance.
Extension management
By default, it installs all extensions. If you don't want to install or activate all extensions, you can customize it using a .shopware-project.yml
Automatic Store Login
You must log in to the Shopware Store to use any app with an external backend. Shopware Commercial requires the same login for automatic license key updates. The Deployment Helper can automatically log you into the Store if you set the following environment variables:
SHOPWARE_STORE_ACCOUNT_EMAIL
- Your Shopware Account emailSHOPWARE_STORE_ACCOUNT_PASSWORD
- Your Shopware Account PasswordSHOPWARE_STORE_LICENSE_DOMAIN
- Your Shopware Account License Domain
Besides logging in, it checks on every deployment if the stored credentials in Shopware are still valid when not automatically replacing them.
What if I need to run custom commands?
The Deployment Helper lets you run completely custom commands. There are two ways of running commands in the Deployment Helper: Hooks and One-Time Tasks. Let's start with Hooks.
Hooks allow you to run additional commands in a Lifecycle of Deployment Helper. Right now, these are:
pre (Before executing logic in Deployment Helper)
pre-install (Before executing logic to install Shopware)
post-install (After the install logic)
pre-update (Before executing logic to update Shopware)
post-update (After the update logic)
post (After the logic in Deployment Helper)
You can define these in the same .shopware-project.yml
.
One-time tasks are always executed afterward but are executed only once. This is handy when running a Symfony Command to fix a data structure or trigger only-once indexers.
Define these less strictly in the .shopware-project.yml
.
To track script execution, Shopware uses the id
and stores that data in its database. You can review the execution history and timestamps of one-time tasks with the command vendor/bin/shopware-deployment-helper one-time-task:list
. There are also commands to mark a one-time task as executed or remove it again.
Why is this not integrated into Shopware itself?
The Deployment Helper is a standalone tool, so we can support all Shopware versions beginning with 6.5. The decoupling of Shopware itself helps us iterate much faster and provide faster features or bug fixes.
Conclusion
We try to unify the Shopware Deployment Landscape with the Deployment Helper so that individual projects have a similar setup. We have already integrated the Deployment Helper into the Docker Image and Shopware PaaS and updated the Deployment Documentation to use it. If you want to learn more about the Deployment Helper, check the documentation. If you have questions, feel free to join the Community Slack and enter the Channel #hosting
or create GitHub issues.