Here is part of the answer to my question ...
I wanted the team to be able to unlock the code and immediately show it at the URL: http://branch-name.devserver.com
I set the vhost directives in apache conf to map subdomains to folders:
<VirtualHost *:80> ServerName www.devserver.com ServerAlias *.devserver.com VirtualDocumentRoot /var/www/devserver/%1/ </VirtualHost>
I enter the code in github or on my local machine.
Then run these commands on the dev server
cd /var/www/devserver git clone git@github.com :/user-name/repos-name
Move the cloned repository folder to the folder with the name of the branch so that it becomes the root folder of the virtual host of the subdomain.
mv repos-name new-branch
Then switch the repositories from the wizard to the new branch
cd /var/www/devserver/new-branch git checkout new-branch
Now it is available at http://new-branch.devserver.com
Then after I introduced the changes to the branch on github - I pull them to the dev server
cd /var/www/devserver/new-branch git pull
Now - if I want the pull to happen automatically, I could configure the CI server to listen to the git hub hook, which triggers a trigger in each branch folder. Hudson seemed to be able to do this.
I was hoping to find a smarter way to do this:
- Without cloning repositions many times
- With a single command that effectively updates all branches or a hook that allows me to pull only to the updated branch
- With a decent folder structure for each branch - so that I could test any branch at a specific URL without having to bind to the http config every time I enter the code
- possibly automatically creating a root folder for new branches so that they are magically displayed on the dev server
Any further thoughts are welcome ...
Boz
source share