Websites and SCMs branches, there has to be a better way.
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?