In Magento 2 we store config data which is only relevant for production in the env.php
- so it is not included in DB dumps and such.
Is this possible in Shopware 6 ?
For example, if I have a plugin config like
JopsoMonitoring.config.sentryEnvironment
I can already call
`bin/console system:config:set JopsoMonitoring.config.sentryEnvironment dev'
But can I also write something like
JopsoMonitoring.config.sentryEnvironment
in the .env
?
That's currently not supported, but it's an interesting idea. The SystemConfigService
relies on the settings being stored in the database so the service would have to be refactored to account for environment variables. A quick solution would be to write a CLI command implementation that uses dotenv
to read the config settings, maybe detectable by a certain prefix, and persists the values via the SystemConfigService
. That command could then be automated to be executed after deployment.
If third-party tool are an option, you could have a look at shopware-cli
that comes with a command to push config setting from a yml file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With