Rip's Domain

Websites and SCMs branches, there has to be a better way.

Posted in Apache, Git, IIS, Linux, SCM, SVN, Windows by rip747 on September 24, 2009

Has this ever happened to you? You’re programming a website and within your source control manager (SCM) you have several branches. One branch could be the current version of the website (trunk or master depending on your SCM) and other branches could contain some new features or bugs fixes that you’re working on.

Now you want to test out or show the new features or bugfixes to your team or employer that are contained within these other branches and this is where the problem lies, how do you deploy these branches? Well its pretty easy right? You setup and configure an entirely new website to have the people hit that branch. So if your current version is residing on http://www.example.com, you might setup and configure a new website at www1.example.com for the branch you want people to have a look at.

To me this is a HUGE waste of time. For every branch you need to demo or test, you need to create a new website. Wouldn’t it be great if there was something out there that could allow the webserver to talk to your SCM directly and pull back the branch that you want simply be addressing it in the url?

For instance. Let’s say in my SCM I have a master branch containing the current version of the website and a branch called bug27 that contains some fixes for a bug I’m working on. Now if I wanted people to access both of these branches from the internet, I would have to configure two websites on my webserver. http://www.example.com would point to a directory containing the master branch files and bug27.example.com would point a different directory containing the bug27 branch files.

Imagine if all I had to do was to configure one website with two host headers, one for master at http://www.example.com and one for bug27 at bug27.example.com. Then just point the website to my SCM repo. Now depending on which host the people come to the website with, the webserver would be smart enough to pull back that branch from my SCM. This totally eliminates the need to configure a new website for every branch that you have.

That said, is there anything out there like this for Apache or IIS?

One Response

Subscribe to comments with RSS.

  1. Joris said, on February 4, 2010 at 11:35 pm

    Sounds like a good idea, but it takes at least 15 minutes for me to do a full checkout of my website, (300mb, 1000s of files).

    Why not setup some kind of Ant task to help you automate the creation of the new site when you tag a version?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: