1

Is a good practice to run a web app directly from a repository checkout? i.e. if I do a git clone and then start up my backend servers which the front end proxies to.

I've generally felt that it's the "right way" to run it out a directory that is a single version exported but I can't find any compelling arguments for either way of doing it.

Any insights would be useful.

1 Answer 1

1

There is nothing wrong with it. There are many deployment scripts that work that way and I think it is even a very good idea.

It's also a good idea to use tags to check out the correct version from the repository, or maybe a release branch.

6
  • Well, I'd think the right way is to checkout the right version, export that and then deploy it to the production area rather than putting the .git directory along with the rest of the files in the production area. Jul 19, 2011 at 8:02
  • I don't think there is a "right way" or "wrong way". What is the advantage you get from checkout->export->deploy ? I think it is more work, if done from script there are more steps that could fail and updating to a different version is also more complicated then switching to a new tag
    – Bastian
    Jul 19, 2011 at 8:33
  • I would never switch to a different tag in a live production environment. I'd try it out somewhere else, make sure and then deploy that tag. Wouldn't that be safer? Jul 19, 2011 at 8:55
  • Why would it not be safe? Personally I would check out the tag to a new directory, but after switching to a different tag the files will be up to date. I have more trust to git that the files are correct after a successful git action than I would have after a ftp transfer.
    – Bastian
    Jul 19, 2011 at 9:19
  • Because the app would not be restarted and if it lazy loaded a template or something which was changed but used the version of the code which was not, bad things would happen. Jul 19, 2011 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.