1

Firstly, I know about this post: Where does gitosis store the working copies?. But I'm consider to create this message to concrete the answer of that.

Where does gitosis store the working copies?

Can anybody, please, make some concrete?

Can I do this trick via post hooks? I have exactly same problem, and think about how to make newly pushed files accessible for a web server virtualhost, where's application is store.

Are there any examples maybe?

Thanks.

Community
  • 1
  • 1

1 Answers1

1

The problem from the previous question was:

how can I manage to write my deploy-script without knowing the path of the working copy?

The answer is: you alone can determine that path, because gitosis like gitolite only manage bare repos, which, as their name suggests (bare) are without working tree.

I would suggest to:

  • use gitolite instead of gitosis (obsolete and no longer maintained)
  • use a VREF (an update hook) which can deploy the repo in any working tree of your choice, with a hook content similar to this one.
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • As I understand - the destination directory, where checkout will be do, must be initialized as a non-bare repository, right? – Evgenii Iablokov Feb 28 '13 at 15:37
  • @Evgeniy yes, it can be as simple as cloning the bare repo in the destination directory. That clone will be by default a non-bare one. – VonC Feb 28 '13 at 16:05
  • I have to come back to this йгуыешщт in order to clarify one thing. Which method could be fine to correct the permissions when using this hook? I mean we have a user for git, and we have an apache user. Hook works just fine, but the user is git:git, for example. What is the best practice to change it for an apache, so there are right perms for the web server? – Evgenii Iablokov Mar 07 '13 at 09:49
  • @Evgeniy For instance, http://stackoverflow.com/a/7545029/6309 with a sudo to execute as apache. – VonC Mar 07 '13 at 10:21