I won’t go into detail explaining version control, because there are countless articles and papers in the wild about it. I am, however going to explain how I am implementing Subversion into my current development environment.
First, my reasons for using version control
- No SPOF(Single point of failure) - My flow always has 3 concurrent copies of the source at any given point, so if one machine fails fatily, my project data is still safe.
- Repository - Having a repository means I can revert to older versions if needed, as well as keep up with changes made each step along the way.
- No direct Editing- I never have to touch staging or live servers, I only modify the development copy, so that human error is reduced ten-fold.
Here is how it all works.
I have 3 machines , dev/repo/serv , where dev is my development workstation, repo is the machine hosting the subversion repository, and serv is my http server.
On the http server, in my projects directory, there is a folder for each project I am working on. In the individual project folder, there are 3 other folders, dev/staging/live.
Using Virtual Hosts on httpserv, I make the development folder only accesible by my local network, the staging folder is available by password protection, and the live server is publicly available.
I use Zend Studio For Eclipse with a Subversion/PHP Project and use WebDrive to securely map the projects dev folder onto my local machine. I create/edit/modify project files from my workstation (which holds a cache of project files) on the dev folder on my http server.
I edit files from my workstation, and view the changes on the development vhost. Once I finish adding a module/functionality/milestone on the project and want the clients’ approval, I use a script called svn_sync.sh located in each projects main directory.
Svn_sync.sh, first makes sure you have committed changes to the trunk aka dev folder, after that you specify what source you want to merge and update. Once I finish adding features, I merge the trunk into the staging branch, and update the working copy inside the staging folder. I now can show the client the changes.
Once I have his approval, I run svn_sync.sh again, and have it merge the staging branch into the live branch, and then update the live directory aka The live server.
That is my SDLC (Software development life-cycle). Things are neat and tidy, and I only make changes to the trunk/development folder of the project.
This method is everything I could wish for, High Availability, Reliable, Robust, scalable, and professional.
Sure direct editing and copy -r work, and I maybe overdoing it as a single developer, but I am very happy with my results and would recommend anyone wanting the experience to do the same.


