1

Ok, I am trying to auto deploy my node.js application with git.

This is what I have on my server:

/home/git/myproj.git - bare repo
/home/me/public_html - cloned repo of the aforementioned bare repo

Now the problem is, I cannot pull from myproj.git/hooks/post-receive because the push to the repo is made as the git user so I have permissions problem. I have also tried some deployment scripts but I have been facing a lot of permissions issues.

I have heard of tools like capistrano, fabric, gitolite, but I guess it's too complex for me atm, and I want something easier (very easy to setup, and keep on replicating in multiple projects).

I hope I made myself clear. I think this problem is related - Auto deployment PHP script using Gitolite - but I am not using gitolite and his answer doesn't make sense to me (probably because his English is not too well).

Community
  • 1
  • 1
user1437328
  • 15,546
  • 9
  • 34
  • 44
  • Can you pull from `ssh://git-user@my.machine.net/home/git/myproj.git`? – choroba Jun 05 '12 at 12:43
  • i replied once but seems like my comment is removed. i can `git pull` from `/home/me/public_html` (which pulls from `/home/git/myproj.git`. – user1437328 Jun 05 '12 at 14:09

1 Answers1

1

I first started with git and post-recieve hooks myself but didn't really like them. I then switched to a very simple bash script. Even if you don't use the script it's only like 200 lines in total so it's great to steal some snippets from.

Pickels
  • 33,902
  • 26
  • 118
  • 178
  • i don't think that the documentation is great. can you explain a bit more on how you use it to deploy on production ? like where do you place the scripts and how do you execute them ? – user1437328 Jun 05 '12 at 14:04
  • Well I had no trouble following the documentation and wiki page. Basically it's a script that executes commands on your server through ssh. It has a post/pre deploy hook which you can add scripts to. It also supports different environments in the config file. Once it's setup you only have to do deploy . – Pickels Jun 05 '12 at 14:17