Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN checkout or export for production environment?

Tags:

svn

deployment

In a project I am working on, we have an ongoing discussion amongst the dev team - should the production environment be deployed as a checkout from the SVN repository or as an export?

The development environment is obviously a checkout, since it is constantly updated. For the production, I'm personally for checking out the main trunk, since it makes future updates easier (just run svn update). However some of the devs are against it, as svn creates files with the group/owner and permissions of the svn process (this is on a linux OS, so those things matter), and also having the .svn directories on the production seem to them to be somewhat dirty.

Also, if it is a checkout - how do you push individual features to the production without including in-development code? do you use tags or branch out for each feature? any alternatives?

EDIT: I might not have been clear - one of the requirement is to be able to constantly be able to push fixes to the production environment. We want to avoid a complete build (which takes much longer than a simple update) just for pushing critical fixes.

like image 946
Eran Galperin Avatar asked Oct 06 '08 16:10

Eran Galperin


2 Answers

The Subversion FAQ seems to advocate deployment as a checkout, autoupdated with post-commit hook scripts. They prevent Apache from exporting .svn folders (probably a good idea) by adding the following in httpd.conf:

# Disallow browsing of Subversion working copy administrative dirs. <DirectoryMatch "^/.*/\.svn/">     Order deny,allow     Deny from all </DirectoryMatch> 

I'm extremely new to svn myself, but maybe you could trigger a hook script when you create a new tag. That way, when you're ready to update the live site, you just commit your last changes to the trunk, create the new tag, and the script updates your live site with svn update.

like image 155
Chris Avatar answered Sep 21 '22 06:09

Chris


I've been struggling with this, and I think I finally decided on checkout. Yes, there is extra junk there, but...

  • Export doesn't account for deleted files (unless your solution is to delete everything in the dir and THEN export, which I think is way worse). Checkout will remove deleted files.
  • Checkout is faster. Period. Fewer files being updated means less down/transition time, and an export pulls down and overwrites EVERYTHING, not just files needing an update.

Not saying it'll work for everyone, but these two things influenced my decision. Best of luck with your decision.

like image 39
jcelgin Avatar answered Sep 21 '22 06:09

jcelgin