Magento 2 Zero Downtime Deployment is the extension that solves your problems with the 503 maintenance pages during deployment time. It prevents your website from breaking and you from losing potential customers even when running the static content deploy commands. Moreover, the configuration is really simple. So let's get to it.
Zero Downtime Deployment configuration has 4 different sections: General, Instance Files and Folders, Composer and Git within which you can find different options.
Following steps to configure Magento 2 Zero Downtime Deployment extension:
1. Navigate to Stores > Configuration > Magefan Extensions > Zero Downtime Deployment.
2. Enable the extension.
3. Select the Static Content Deploy option. You can Deploy Only Enabled Themes or Deploy All Themes.
4. Define how many jobs you want to be processed parallelly during deployment in the Count of Jobs For Parallel Processing Of Static Content Deploy field.
5. Choose whether to Enable all Caches After Deploy since sometimes some of them can be disabled after deployment.
6. Enter the Magento CLI Command you want to use during deployment.
Instance Files And Folders
7. Specify files you'd like to Copy To Temporary Instance or Copy From Temporary Instance each in a new line.
8. Enable the Pull From Composer option in case you use git.
Note: once you enable this option the extension will run the composer install command to get a new code via composer during deployment.
9. Enter the Composer CLI Command.
Note: depending on your environment you can choose some specific composer CLI commands.
e.g. php -dmemory_limit=-1 /ysr/bin/composer or composer --ignore-platform-reqs or composer.phar
10. Enable the Pull From Git option in case you use Git. Once you enable this option the extension will run a command to pull the new code from your git repository during the deployment.
11. Specify the Git Branch To Pull From.
12. Choose whether you want to Enable Webhooks.
13. Enter the Webhooks Secret. Please enter some random characters in the "Secret Key" field and use this URL in Git settings for Webhooks after you save the config.
Once you finish with the configuration don't forget to Save Config and enjoy the deployment with no website performance interruptions. Besides, if you want to switch to production or any other Magento mode, use the following command:
bin/magento magefan:zero-downtime:deploy-mode-set -m
You can also check how easy it is to install the extension without website interruptions in this video. We go through all steps, one by one, to show you how Magento 2 Zero Downtime Deployment extension works.
Excited to use it already?
To start with, you can check the most basic zero downtime deployment commands to use deploying your Magento 2 store!