I work in a small team doing web sites as well as web apps. We have a development server locally that is set up identically to our standard production servers, and I'd like to integrate Git into our workflow. I'm currently using Gitlab to host and access the repositories.
How I envision it is:
- pull from central repositories
- develop locally
- push to dev server
- test
- merge
- qc
- package and ship to production server
My question involves the pushing to dev server stage. I'd like to be able to push a branch to dev server, then immediately browse view that branch in a browser — not the source code, but the site itself.
Is there self-hosted software that could be used to accomplish this?
Like I say, I'm currently using Gitlab. I've tried Gitorious (too much to set up), Girocco, git-php and could not get them working on our development server, at least not without changing them, which defeats the point of having identical dev and production servers.
This question is predicated on my workflow being sound. If my question is rendered moot by poor workflow, I'd be be happy to have the mistakes in my workflow pointed out.
Update: We mostly develop in PHP (various frameworks and CMSes) and our servers run Apache behind Nginx on Ubuntu 10.04. The different developers are in separate offices in the same building, but on different networks. While we cannot reach each other's machines directly, we can all access the dev server on any port.
Update X2: VonC's answer cleaned up most of the question I have but understanding this a bit better, I'd like to ask a bit more specific question:
As I'm running gitolite (Gitlab is built on this), and as gitolite stores bare repositories, when pushing a branch to the development server, I can't browse the site on the dev server the way I could if there were a working folder. While I could SSH into the dev server's /var/www, git init
and git clone git@127.0.0.1...
from the gitolite bare repository, I would prefer that this get done automatically.
Would the most direct way of accomplishing this be a post-update hook with the above commands? It seems a bit more complex than I like, but I imagine this a fairly common use case so perhaps I'm just missing something.