We have a BETA site for proposed changes/updates that if approved will get moved to the PRODUCTION (LIVE) site. Is there an option/extension that will automate those changes rather than having to log and apply the same changes from BETA to LIVE manually?
I have to work this way daily to keep various servers in sync. The trick is to make a module with upgrade scripts. Let's pretend you have this module:
<config> <modules> <Jeff_Content> <!-- keep this number in mind --> <version>1.0.0</version> </Jeff_Content> </modules> <global> <resources> <!-- this name is used for a folder next --> <jeffcontent_setup> <setup> <module>Jeff_Content</module> </setup> </jeffcontent_setup> </resources> </global> </config>
<?php /* @var $this Mage_Core_Model_Resource_Setup */ $this->startSetup(); Mage::getModel('cms/block') ->setIdentifier('example_block_id') ->setTitle('Example Block Title') ->setContent('Example block content goes here.') ->setIsActive(true) ->setStores(array(0)) ->save(); $this->endSetup();
The first time each site sees this module (ie. after their config cache is refreshed) they'll run the above script once, adding a new block. For a second script change the version number in
1.0.1 and create
These scripts may contain any type of content you wish such as; CMS pages, products, categories, attributes, attribute sets, promotions, etc. A favourite of mine is changing configuration values, useful when setting a default value in XML won't work.
$this->startSetup(); Mage::getModel('core/config_data') ->setPath('design/package/name') ->setValue('custom_design') ->save(); $this->endSetup();
This is perfectly suited for git as long as you keep going forwards. If you rollback a commit after it has been deployed the change doesn't get undone, sadly. (This is being addressed in Magento2)
Depending on your git hosting setup you can then clear the cache by webhook so there is no admin interaction at all.