When you create your project, code is ready to branch, develop, and push for building and deploying your site. Although the Integration environment can have many branches, Staging and Production have only one branch: the deployed Git master.

  1. Create development branches from the Integration master branch.
  2. Develop on local: custom modules, Magento extensions, 3rd party integrations, and configurations.
  3. Push your local branch to the Git remote branch to test in a full environment.
  4. Merge final code to the Integration master branch.
  5. To fully test in a near-production level environment, push code to the Staging environment.
  6. Fully test in the Staging environment including payment gateways, shipping, price rules, various products, and full customer and admin interactions.
  7. Finally, deploy to the Production environment to complete testing, go live steps, and start selling.

Deployment Steps

Log in to your production server.

Change directory to the Magento base directory:

cd <Magento base directory>

Enable maintenance mode using the command:

bin/magento maintenance:enable

Apply updates to Magento or its components using the following command pattern:

composer require <package> <version> --no-update

package: The name of the package you want to update.

For example:

  • magento/product-community-edition
  • magento/product-enterprise-edition

version: The target version of the package you want to update.

Update Magento’s components with Composer:

composer update

Update the database schema and data:

bin/magento setup:upgrade

Compile the code:

bin/magento setup:di:compile

Deploy static content:

bin/magento setup:static-content:deploy

Clean the cache:

bin/magento cache:clean

Exit maintenance mode:

bin/magento maintenance:disable