I’ve always used Subversion (SVN) in C/C++/Obj-C development, but I’ve recently made the transition to using SVN for LAMP development as well, starting with my work on Darkroom. This affords greatly simplified testing, uploading and synchronization, as well as, of course, providing version control.
With SVN, it is possible to maintain a trunk and stable release versions, while working on a development branch. As changes are made and committed to SVN on a development machine, those changes can be mirrored on a working copy on the testing webserver with a simple
svn update
.The requirements for the system I am using:
- A webserver with SVN installed.
- An SVN server accessible from your webserver, and your development machine.
- Eclipse (or an IDE of your choosing) with Subclipse (or other SVN integration).
Once you have committed your project (Trunk, Branches, etc) to the repository, you will need to place these on the webserver. Supposing we are running a testing subdomain at testbed.myproduct.com, with the full serverpath being
/home/www/testbed.myproduct.com
, you will need to SSH over to /home/www/
. Now, for the checkout, your repository might be located at svn://myrepo.myproduct.com/myproject/branch1.1/
. If we were to check this out, we would end up with a branch1.1
subdirectory on the webserver, which is not what we want. Instead, we use the following syntax for SVN:svn checkout svn://myrepo.myproduct.com/myproject/branch1.1/ testbed.myproduct.com
The second argument will cause SVN to check the 1.1 branch into our subdomain. At this point, SVN commands can be executed in that directory, and we have our synchronization in place.
With this method, you’ll no longer need to FTP changes to a testing server or have to worry about which files were changed. I have found this to be greatly helpful in my projects, and I hope you will too.
Good Luck!
No comments:
Post a Comment