Manage build and deploy actions
.magento.env.yaml file centralizes the management of build and deploy actions across all of your environments, including Pro Staging and Production, using environment variables.
Unlike other YAML configuration files, such as
.magento/services.yaml, you can use this file to manage configuration settings without opening a support ticket.
- Settings you configure with environment variables using the
magento-cloudCLI tool or Project Web Interface override settings in the
- If you want to configure unique actions in each environment, you must modify this file in each environment’s Git branch.
Add the following sections to the
global—Controls actions in both the build and deploy phases. You can override these settings in the build and deploy sections.
build—Controls actions in the build phase only. If you do not specify settings in this section, the build phase uses settings from the global section. Settings in the
build_options.inifile override settings in this section.
deploy—Controls actions in the deploy phase only. If you do not specify settings in this section, the deploy phase uses settings from the global section. Settings you configure with environment variables using the
magento-cloudCLI tool or Project Web Interface override settings in this section.
The following example shows how to minimize downtime during deployment by managing static content deployment:
stage: global: SCD_STRATEGY: standard # You cannot modify the strategy in 2.1.x. SKIP_SCD: true # Skip static content deployment for both phases; you can override this in the build and deploy sections build: SKIP_SCD: false # Override the global setting and perform static content deployment in the build phase SCD_COMPRESSION_LEVEL: 6 # Use the default gzip compression level for static content in the build phase deploy: SCD_COMPRESSION_LEVEL: 4 # Reduce the gzip compression level for static content in the deploy phase