This guide provides a step-by-step process for setting up a local development environment for Shopware PaaS using the provided Bash script.
Clone the necessary repositories to your local machine:
git clone git@github.com:bemeir/cds-shopware6.git
cd cds-shopware6
git checkout "Branch of your choice (e.g., 'master', 'staging', 'development')"
NOTE: USE development for now. It should contain all of the work and feel free to push everything in it. Static and etc files. We are working on Theme Architecture and we will be further
cleaning everything.
git clone git@github.com:bemeir/shopware-paas-local-dev.git
Install and configure DDEV on your machine by following the official DDEV installation guide.
- Git: For version control and repository management.
- Bash Shell: Required to execute the provided setup script.
- jq: Command-line JSON processor (required for plugin activation).
- Creates a timestamped backup of the root
services.yaml
before replacing it. - Backups are stored in the
dev-bemeir/config-backup/
directory.
- Replaces the root
services.yaml
with theservices_local.yaml
from thedev-bemeir/
folder.
- Copies
.env
and.env.local
from thedev-bemeir/
folder to the root of the project.
- Generates a new
APP_SECRET
and updates it in both.env
and.env.local
files.
- Dumps the current environment database remotely and downloads it locally for restoration.
- Imports the downloaded database dump into the local environment using DDEV.
- Installs necessary add-ons such as Redis, OpenSearch, and RabbitMQ.
- Executes
bin/build-js.sh
to build JavaScript files for the Shopware project.
- Ensures the
install.lock
file exists in the project root.
- Iterates over all plugins in the Shopware project and activates any inactive or uninstalled plugins.
Navigate to the shopware-paas-local-dev
folder and execute the setup script:
cd shopware-paas-local-dev/
chmod +x setup_env.sh
cd ..
./shopware-paas-local-dev/setup_env.sh
- Backup
services.yaml
:- Creates a backup in
config-backup/
with a timestamped filename. - this is important when we push work to branch ignore the config/services.yaml both platform.sh and locals use it.
- Creates a backup in
- Replace
services.yaml
:- Replaces the root
services.yaml
withservices_local.yaml
.
- Replaces the root
- Copy
.env
and.env.local
:- Moves these environment files to the project root.
- Generate
APP_SECRET
:- Updates the secret in
.env
and.env.local
files.
- Updates the secret in
- Dump and Download Database:
- Downloads the database dump from the remote environment.
- Restore Database:
- Imports the database into DDEV.
- Install Add-ons:
- Installs Redis, OpenSearch, and RabbitMQ add-ons using DDEV.
- Run JavaScript Build:
- Builds JavaScript using
bin/build-js.sh
.
- Builds JavaScript using
- Create
install.lock
:- Ensures the
install.lock
file exists in the root.
- Ensures the
- Activate Plugins:
- Installs and activates all plugins.
- Ensure the
dev-bemeir
folder contains the requiredservices_local.yaml
,.env
, and.env.local
files before running the script. - The script assumes you have valid credentials for accessing the remote database.
- Install necessary tools (
jq
,git
, etc.) before executing the script.
This script is provided as-is for development purposes. Handle sensitive data securely. .env and .env.local have APP_SECRET of the current broken stage so we can continue working but we will be removing this and making sure its not defined as part of this repo. Please note that we still have to edit .env and .env.local well only .env.local after this build script finishes if we want to change some things like the said APP_SECRET.