Giter Site home page Giter Site logo

magento2-zero-downtime-deploy's Introduction

Attention! This script is deprecated, we strongly recommend to use Magento 2 Zero Downtime Deployment Extension.

1. Install Magento 2 zero-downtime deployment script

wget -O deploy.zip https://github.com/dndeus/magento2-zero-downtime-deploy/archive/master.zip
unzip deploy.zip
rm -f deploy.zip
mv magento2-zero-downtime-deploy-master/ deploy
cp deploy/app/static-content-deploy.sh.sample deploy/app/static-content-deploy.sh
cp app/etc/env.php deploy/app/env.php
echo $'\n'deploy/app/env.php >> .gitignore
chmod +x deploy/run

2. Configure zero-downtime script

If you use specific static-content deploy commands then edit the file

deploy/app/static-content-deploy.sh

By default, it has commands to deploy all Magento 2 themes in en_US locale.

If you use Redis or other non-folder storage for session or cache, then edit the file

deploy/app/env.php

Make sure that the cache and session are stored in a folder.

3. Use M2 zero-downtime deploy script

To deploy Magento static content (bin/magento setup:static-content:deploy) with NO downtime, use the CLI command:

deploy/run -s

To generated code and dependency injection configuration (bin/magento setup:di:compile) with NO downtime, use the CLI command:

deploy/run -d

You can also run the script with multiple parameters, e.g:

deploy/run -d -s

To update Magento 2 modules database data and schema (bin/magento setup:upgrade), use the CLI command:

deploy/run

If you install new extensions then run this command:

deploy/run -m Vendor_Module1 Vendor_Module2

Note that these commands will also run DI and static content generation and this is the only command that put Magento 2 store into maintenance mode for a few seconds while setup:upgrade is running.

Magento 2 Extensions by Magefan

magento2-zero-downtime-deploy's People

Contributors

magefan avatar dndeus avatar ihorvansach avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.