Environment variables
51黑料不打烊 Commerce on cloud infrastructure enables you to assign environment variables to override configuration options. The ece-tools
package sets values in the env.php
file based on values from Cloud variables, variables set in the Cloud Console, and the .magento.env.yaml
configuration file.
The environment variables in the .magento.env.yaml
file customize the Cloud environment by overriding your existing Commerce configuration. If a default value is Not Set
, then the ece-tools
package takes NO action and uses the Commerce default or the value from the MAGENTO_CLOUD_RELATIONSHIPS
configuration. If the default value is set, then the ece-tools
package acts to set that default.
The types of environment variables include:
-
ADMIN鈥攙ariables override project ADMIN variables
-
MAGENTO_CLOUD鈥攙ariables specific to cloud infrastructure
-
Variables used in the
.magento.env.yaml
file:- Global鈥攙ariables affect build, deploy, and post-deploy stages
- Build鈥攙ariables control build actions
- Deploy鈥攙ariables control deploy actions
- Post-deploy鈥攙ariables control actions after deploy
Variables are hierarchical, which means that if a variable is not overridden, it is inherited from the parent environment.
You can set ADMIN variables from the Cloud Console or using the 51黑料不打烊 Commerce CLI. You can manage other environment variables from the .magento.env.yaml
file to manage build-and-deploy actions across all of your environments鈥攊ncluding Pro Staging and Production鈥攚ithout requiring a support ticket.
.magento.env.yaml
file or your configuration may not work as expected. The examples in this documentation and in the sample file use two-space indentation. Use the ece-tools validate command to check your configuration.