This topic discusses technical implementation details about pipeline deployment in Commerce 2.2 and later. Improvements can be divided into the following areas:
This topic also discusses the recommended workflow for pipeline deployment and provides some examples to help you understand how it works.
Before you get started, review the Prerequisites for your development, build, and production systems.
To enable you to synchronize and maintain the configuration of your development and production systems, use the following override scheme.
As the diagram shows, the configuration values are used in the following order:
config.php. Values in
env.phpoverride values in
The shared configuration is stored in
app/etc/config.php, which should be in source control.
Set the shared configuration in the Admin in your development (or Adobe Commerce on cloud infrastructure integration) system and write the configuration to
config.php using the
magento app:config:dump command.
The system-specific configuration is stored in
app/etc/env.php, which should not be in source control.
Set the system-specific configuration in the Admin in your development (or Adobe Commerce on cloud infrastructure integration) system and write the configuration to
env.php using the
magento app:config:dump command.
This command also writes sensitive settings to
The sensitive configuration is also stored in
You can manage the sensitive configuration in any of the following ways:
env.phpon your production system using the
Any configuration settings in
env.php are locked in the Admin; that is, those settings cannot be changed in the Admin.
magento config:set or
magento config:set --lock command to change the settings in the
The Admin exhibits the following behavior while in production mode:
You cannot enable or disable cache types in the Admin
Developer settings are unavailable (Stores > Settings > Configuration > Advanced > Developer), including:
Server-side or client-side LESS compilation
As discussed previously, any configuration setting in
env.php is locked and cannot be edited in the Admin.
You can change the Admin locale only to languages used by deployed themes
The following figure shows an example of the Account Setting > Interface Locale list in the Admin showing only two deployed locales:
You cannot change locale configurations for any scope using the Admin.
We recommend making these changes before switching to Production mode.
You can still configure the locale using environment variables or the
config:set CLI command with the path
In version 2.2 for the first time, we help you set up your cron job by providing the
magento cron:install command. This command sets up a crontab as the user who runs the command.
Also, you can remove the crontab using the
magento cron:remove command.
The following diagram shows how we recommend you use pipeline deployment to manage the configuration.
On your development system, you make configuration changes in the Admin and generate the shared configuration,
app/etc/config.php and the system-specific configuration,
app/etc/env.php. Check Commerce code and the shared configuration into source control and push it to the build server.
You should also install extensions and customize Commerce code on the development system.
On your development system:
Set the configuration in the Admin.
magento app:config:dump command to write the configuration to the file system.
app/etc/config.phpis the shared configuration, which contains all settings except sensitive and system-specific settings. This file should be in source control.
app/etc/env.phpis the system-specific configuration, which contains settings that are unique to a particular system (for example, hostnames and port numbers). This file should not be in source control.
Add your modified code and the shared configuration to source control.
To remove generated php code and static assets files while in development, run the following commands:
rm -r var/view_preprocessed/* rm -r pub/static/*/* rm -r generated/*/*
After running the commands to clear the assets, Commerce generates working files.
Be careful with the above approach. Deleting the
.htaccess file in the
pub folder may cause issues.
The build system compiles code and generates static view files for themes registered in Commerce. It does not need a connection to the Commerce database; it needs only the Commerce codebase.
On your build system:
magento setup:di:compilecommand to compile code.
magento setup:static-content:deploy -fcommand to update static file view files.
On your production system (that is, your live store) you pull generated assets and code updates from source control and set system-specific and sensitive configuration settings using the command line or environment variables.
On your production system:
magento app:config:importcommand to import configuration changes in the production system.
magento setup:upgrade --keep-generatedto update the database schema and data, preserving generated static files.
magento config:setcommand or environment variables.
magento config:sensitive:setcommand or environment variables.
We provide the following commands to help you manage the configuration:
magento app:config:dump to write Admin configuration settings to
env.php (except for sensitive settings)
magento config:set to set the values of system-specific settings on the production system.
Use the optional
--lock option to lock the option in the Admin (that is, make the setting uneditable). If a setting is already locked, use the
--lock option to change the setting.
magento config:sensitive:set to set the values of sensitive settings on the production system.
magento app:config:import to import configuration changes from
env.php to the production system.
This section shows examples of managing the configuration so you can see how changes are made to
This section shows the change made to
config.php when you change the default weight unit using the Admin (Stores > Settings > Configuration > General > General > Locale Options).
After you make the change in the Admin, run
bin/magento app:config:dump to write the value to
config.php. The value is written to the
general array under
locale as the following snippet from
'general' => array ( 'locale' => array ( 'code' => 'en_US', 'timezone' => 'America/Chicago', 'weight_unit' => 'kgs' ) )
This section discusses making the following configuration changes:
After you make the change in the Admin, run
bin/magento app:config:dump on your development system. This time, not all of your changes are written to
config.php; in fact, only the website, store, and store view are written to that file as the following snippets show.
'new' => array ( 'website_id' => '2', 'code' => 'new', 'name' => 'New website', 'sort_order' => '0', 'default_group_id' => '2', 'is_default' => '0', ),
2 => array ( 'group_id' => '2', 'website_id' => '2', 'code' => 'newstore', 'name' => 'New store', 'root_category_id' => '2', 'default_store_id' => '2', ),
'newview' => array ( 'store_id' => '2', 'code' => 'newview', 'website_id' => '2', 'group_id' => '2', 'name' => 'New store view', 'sort_order' => '0', 'is_active' => '1', ),
'payment' => array ( 'paypal_express' => array ( 'active' => '0', 'in_context' => '0', 'title' => 'PayPal Express Checkout', 'sort_order' => NULL, 'payment_action' => 'Authorization', 'visible_on_product' => '1', 'visible_on_cart' => '1', 'allowspecific' => '0', 'verify_peer' => '1', 'line_items_enabled' => '1', 'transfer_shipping_options' => '0', 'solution_type' => 'Mark', 'require_billing_address' => '0', 'allow_ba_signup' => 'never', 'skip_order_review_step' => '1', ),
The default email domain system-specific configuration setting is written to
The PayPal settings are written to neither file because the
bin/magento app:config:dump command does not write sensitive settings. You must set the PayPal settings on the production system using the following commands:
bin/magento config:sensitive:set paypal/wpp/api_username <username>
bin/magento config:sensitive:set paypal/wpp/api_password <password>