Pergunta

We are using a Windows development server for hosting my Git bare repo. We use direct file access to the server (no SSH, GIT or HTTP). This works excellent, and the team is happy.

We are now trying to have the development server perform a deploy operation every time someone pushes code in the bare repo. We created a local repo at the server and added the bare repo as remote for that as well.

We found out that using local paths in the post-receive hook does not work at all. The post-receive hook seems to search folders on the client's system instead of on the server itself. When we use //server/c$/[path] on the server (and also for the server local repo's remote settings) everything seems to work - but very slow. It is starting to drive us nuts currently, so we stopped using it for now :( .

In short, our questions are:

  1. Is it true that post-receive has a client local scope?
  2. If 1 is true: is it possible to get post-receive to operate in the server's scope?
  3. Has anybody successfully used a mechanism like described hereabove?

Thanks a lot for your help!

Foi útil?

Solução 2

It turns out that when deploying using file paths the scope remains the client scope. This seems to be by design, therefore, I had to search for another publishing option.

I now use WebGitNet (github.com/otac0n/WebGitNet) for pushing, which enables me to post over http(s) and doing this, it also operates in the server's scope. Currently, I am also pulling using the same mechanism, but I don't have to - for speed I could also choose file system access for pulling...

Outras dicas

put your hook in the .git/hook of the server instead your local and do the checks

Also, deploy system has to be handle every case reset, tagging.

Here an deploy script (it not deal with every case but you can take it and improve it)

https://gist.github.com/4621684

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top