I have not found too much information on an efficient process for a rolling development of my site so I can add custom modules and other file changes on staging and then push those changes onto the live copy of my site with magento2.
In Magento 1.9 we just had a git clone of the files and git pulled all changes that were ready for the live site this obviously will not work in magento2 were my staging site is in developer mode and my live site is in production.
What is the best practice that involves the least live site downtime ?
(no downtime would be optimal if that is possible)
Best Answer
You can use ansible to automate the steps :
From a global point of view :
(Manage all your changes with setup/upgrade scripts)
bin/magento setup:install
with parameters./bin/magento setup:upgrade
./bin/magento setup:di:compile -vvv
./bin/magento cache:clean
./bin/magento deploy:mode:set {{ m2site_mode }}
./bin/magento indexer:reindex
Adapt these steps with your needs.
The clue is to make to steps works for new environement or for existent environement.
You will have downtime if you have some setup script to execute. To minimize downtime, do these steps on a preproduction server, and copy all generated code to your production server. You can reindex data in background.