Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Subversion and MagentoConnect
 
United Media Associates
Member
 
Avatar
Total Posts:  48
Joined:  2008-03-27
 

I’m trying to figure out the best way to use Subversion hand-in-hand with Magento development. Currently Subversion works perfectly for working on themes on a local dev site, and committing the changes back to the repository and the main website.

The issue I’m having is the best way to incorporate MagentoConnect extensions. If I just install the Mage exensions on the site that we have checked out from SVN, the changes never make it into the repository. If I try to install the extensions on a local dev site, that doesn’t seem to work too well either, as the ~/downloader/perlib/pear.ini file seems to have environment-specific paths in it.

Has anyone figured out the best way to work Subversion into the development process? Does the ~/downloader folder need to be excluded from Subversion?

Any ideas and experience would be greatly appreciated!

 
Magento Community Magento Community
Magento Community
Magento Community
 
United Media Associates
Member
 
Avatar
Total Posts:  48
Joined:  2008-03-27
 

I found the following helpful wiki article:

http://www.magentocommerce.com/wiki/groups/174/changing_and_customizing_magento_code

This article describes a detailed process for using Subversion to track local code changes and extensions while also maintaining the ability to commit core upgrades.

 
Magento Community Magento Community
Magento Community
Magento Community
 
evdat
Member
 
Avatar
Total Posts:  35
Joined:  2008-02-28
Carthage, MO
 

From what I can tell it appears that the /downloader/ directory is separate from the rest of the Magento core. I’ve noticed that the /downloader/ directory that comes in the full install archive doesn’t have any machine specific variables or any extra cached downloads, but once you run it for the first time it populates the machine specific variables. What I’ve done is committed the clean /downloader/ directory from the full install archive into SVN so that if I ever need to run it is as if it’s being run for the first time wherever it’s running from.

I’ll watch for change to the Magento Connect Manager extension and replace the /downloader/ directory from a full install archive when it changes, and commit the newer clean /downloader/ directory to SVN.

One down side to this is you don’t have a list in the Magento Connect Manager of what is already installed, because I think it keeps track of that via the cached download files and such. I have just issued a full upgrade each time using the magento-core/Mage_All_Latest key, and it updates all the core modules needed.

This method seems to be working well as I can checkout a copy of the site from SVN onto a development machine, perform an upgrade and test locally to check for any incompatibilities. Then after verifying that the upgrade completed successfully I can commit my changes back into SVN. This at least gives me an opportunity to make sure the upgrade works and doesn’t fail in the middle of it, and it’s all happening on a development machine in a controlled environment. The site can then be exported to a testing server to verify and perform any additional testing prior to exporting to live.

I’m currently not tracking the /media/ directory in SVN, and am ignoring the /var/cache/, /var/session/, /app/etc/local.xml paths so that I don’t commit them into SVN. I have a shell script to copy the /media/ folder from the live site, empty the /var/cache/ and /var/session/ directories and copy the local.xml file that is specific to the machine I’m working with. I also have my shell script backup the live database and restore it to my development machine and clean up a few machine specific records in the database like {{base_url}} in the configs. I basically issue a checkout from SVN into a fresh directory on my development machine, then run my shell script which pulls down a copy of the live database, the media folder, and sets a few machine specific changes in place and I have a working copy on my development machine that mimics the live site for testing and code changes.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top