919 - 926 - 9847

How I use Subversion for Web Development part 2 - SVN2WEB

I tried to get into ANT.  I really did.  I'm hoping to eventually get to a TACFUG meeting where they do an ANT setup tutorial (I think Jim Priest has done those before).  I did discover this nifty little SVN hook script in the meantime, SVN2WEB.  Walk through the installation guide, and come on back.

So how do I use this, and why?  Let's get to the why first.  I loath FTP.  Really, really, really cannot stand it.  Why?  I've been bitten in the arse far too many times to count overwriting files that should not pushed to production.  You also run into issues with multiple developers touching files on the server, and essentially doing their development on the server (instead of locally).  For that reason, I ONLY allow file pushes from the SVN server to production.  That's where this script comes in.

So let's get this set up.  First, read the tutorial on how I use SVN for development.  On our TRUNK folder, we're going to create a new SVN property.

  • Right click anywhere, and choose TortoiseSVN->Repo Browser.
  • Browse to your Test project, and right click the trunk folder and choose Properties.
  •  Create a new property.  Use the name svn2web, and the property value is something like ftp:www.mysite.com:<password>@<username>:<path on server>.  There's also options for local file system copy or SFTP.
  • This should point to your staging/development/test server.
  • Do the same for the PROD_100 branch, but point it at your production server.

So, every time you make a change to TRUNK or PROD, it's automatically reflected in your environments.  As an added plus, you can make just ONE person in charge of PROD, and all merges must go through that single point of entry.
I find it to be a great system.  Everyone on the team develops locally, does acceptance testing on internet staging, and then deploy to production once the acceptance testing is done.

The only real downside?  Small changes can be a bit more time consuming.  You  need to follow the flow of make the change in TRUNK, merge the change into PROD, then commit that change up.  But it does force everyone to follow a procedure, there's no shortcuts, and no code cowboys mucking about with live code.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)