Magento 2.1.18 is the final 2.1.x release. After June 2019, Magento 2.1.x will no longer receive security patches, quality fixes, or documentation updates.
To maintain your site's performance, security, and PCI compliance, upgrade to the latest version of Magento.

Global variables

The following global variables control actions across each phase: build, deploy, and post-deploy. Because global variables impact every phase, you must set them in the global stage of the .magento.env.yaml file:

1
2
3
stage:
  global:
    GLOBAL_VARIABLE_NAME: value

For more information about customizing the build and deploy process:

MIN_LOGGING_LEVEL

  • DefaultNot set
  • Version—Magento 2.1.4 and later

Overrides the minimum logging level for all output streams without making changes to the code. This helps when troubleshooting problems with deployment. For example, if your deployment fails, you can use this variable to increase the logging granularity globally. See Log levels. The min_level value in Logging handlers overwrites this setting.

1
2
3
stage:
  global:
    MIN_LOGGING_LEVEL: debug

SCD_ON_DEMAND

  • DefaultNot set
  • Version—Magento 2.1.4 and later

Enable generation of static content when requested by a user (SCD). This is ideal for the development and testing workflow, because it decreases the deployment time.

Pre-loading the cache using the post_deploy hook reduces site downtime. The cache warming is available only for Pro projects that contain Staging and Production environments in the Project Web UI and for Starter projects. Add the SCD_ON_DEMAND environment variable to the global stage in the .magento.env.yaml file:

1
2
3
stage:
  global:
    SCD_ON_DEMAND: true

The SCD_ON_DEMAND variable skips the SCD and the STATIC_CONTENT_SYMLINK in both phases (build and deploy), clears the pub/static and var/view_preprocessed folders, and writes the following to the app/etc/env.php file:

1
2
3
4
5
return array(
   ...
   'static_content_on_demand_in_production' => 1,
   ...
);

SKIP_HTML_MINIFICATION

  • Default:
    • true—for ece-tools 2002.0.13 and later
    • false—for earlier versions of ece-tools
  • Version—Magento 2.1.4 and later

Enables or disables copying static view files to the <magento_root>/init/ directory at the end of the build stage. If set to true files are not copied and HTML minification is available on request. Set this value to true to reduce downtime when deploying to Staging and Production environments.

  • false—Copies the view_preprocessed directory to the <magento_root>/init/ directory at the end of the build phase, and restores the directory in the <magento_root>/var directory at the beginning of the deploy phase.
  • true—Enables on-demand HTML minification; does not copy the <magento_root>var/view_preprocessed to the <magento_root>/init/ directory at the end of the build phase.

Add the SKIP_HTML_MINIFICATION environment variable to the global stage in the .magento.env.yaml file:

1
2
3
stage:
  global:
    SKIP_HTML_MINIFICATION: true

X_FRAME_CONFIGURATION

  • DefaultNot set
  • Version—Magento 2.1.4 and later

Use the X_FRAME_CONFIGURATION variable to change the X-Frame-Options header configuration for your Magento Commerce site. This configuration controls how the browser renders a page in a <frame>, <iframe>, or <object>. Use one of the following options:

  • DENY—Page cannot be displayed in a frame.
  • SAMEORIGIN—(The default Magento setting.) Page can be displayed only in a frame on the same origin as the page itself.
  • ALLOW-FROM <uri>—Page can be displayed only in a frame on the specified origin.

Add the X_FRAME_CONFIGURATION environment variable to the global stage in the .magento.env.yaml file:

1
2
3
stage:
  global:
    X_FRAME_CONFIGURATION: SAMEORIGIN
Updated