I've just installed Nginx, Phusion Passenger, and and Gitlab on a virtual machine. Almost all my projects will be rails applications. Instead of having to configure them individually, it would be great if I could automatically host them on a subdomain when a new project is created.
So when a user creates a project a nginx config file gets generated to respond to [repo].[user].[mydomain].com
My current plan is to have a script that somehow creates a copy of the master branch in a new location (say /var/www/
) and then generate a matching nginx script.
How do I create a hook that can accomplish this? and how do I only create the repo once and just do a pull if it already exits?
Thanks for the help.