3

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Josh Wilson
  • 3,585
  • 7
  • 32
  • 53

1 Answers1

1

GitLab uses on Gitolite.
And Gitolite allows for update hook as VREF: you can declare one applied for all repos which would generate the file you want and make the appropriate actions, only if said repo is empty (just been created).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250