I have checked other threads relating to this subject, but nothing really solutions my exact question. I am presently creating a site that updates data on the live web server (usually photos) multiple occasions daily utilizing a cron plus some exterior data feeds. Furthermore, we are going to allow user-posted data. Now, I wish to begin using svn since the project gets large so much that it's beginning to obtain relatively complicated the ones are earning edits to the code around the live server. I have installed svn for apache and every one of the subdomains pointed out here are set on one server using vhosts. We've not began by using this workflow yet, therefore if I possibly could acquire some advice before we begin it might be greatly appreciated.
Okay, so I have setup a repository within subdomain (http://svn.website.com), and checked it to an improvement subdomain (http://dev.website.com). I additionally plan to look at a duplicate towards the live atmosphere (http://www.website.com). The concept would be to first develop around the dev subdomain, commit when it is all set to go live, after which
svn up towards the live atmosphere. I have browse the benefits and drawbacks between conveying and upgrading, and upgrading appears perfect for this project because we frequently will commit small tweaks/code changes and conveying appears like overkill. I've also setup the right directives to prevent .svn directory access. Will it seem like I am on course with this particular? Anything I should know?
If this is a great way to take proper care of everything, only then do we can start the 2nd question. The consumer-posted data (mainly photos) are now being submitted towards the live atmosphere. I must in some way manage this between your live and dev atmosphere therefore we can be cultivated with up-to-date user-posted files. I do not fully realize the easiest method to do that...I seem like there is a serious flaw basically would
svn add and
svn ci whenever a file is posted. What's the easiest method to make this happen?
Seems like you are growing!
First, I'd question whether SVN is usually the best option. My prediction is you realize it already, have labored by using it, as have others in your team, and you need to stick to it. That's fine, but simply an FYI I have used SVN and Git and that i found Git generally simpler to make use of, and that i would argue that it's becoming a lot more generally utilized by application designers.
For your workflow, I did previously undergo a nearly identical process having a large distributed team also it labored fine. With respect to the quantity of traffic you receive, I would advise a different production deployment strategy. When you are ready for any new production push, clone right into a new directory, labeled possibly by date or milestone names, and make up a new virtual host for your directory. This way, you receive a couple benefits:
- You do not risk getting someone access the application and asking for a particular file which is incorporated in the procedure for being up-to-date
- It is simple to revert to an early on milestone simply by altering the active production virtual host. Bugs and problems allow it to be from development no matter how completely you test, and often they are serious enough to warrant just reverting to an earlier codebase. Obviously, schema changes would add complexity for this, but when we are just speaking about code this will avoid frantic commit reverts at 2am.
It was recommended by Rasmus Lerdorf in a conference I attended as he was posed nearly exactly the same question you are asking.
For making certain designers will work most abundant in recent fileset, you may not do? If you are processing a significant volume of images, that will find a large amount of hard disk drive space. Sure having a CDN or any other mass storage no large deal, but would you like your designers to need to download 1000 new photos when they svn up?
If you are dead set on carrying this out, I'd suggest adding some code in your application for instantly doing an svn add, svn ci when svn status includes a certain result (ie, this can be a script you can call with cron, or each time new media will get added). You might look at using svn hooks (git has these too) to complete such things as inform you the repo continues to be up-to-date.
Hope this can help. I'd strongly discourage including all the files customers upload unless of course you've got a really, really strong reason behind doing this. The complexness that's gonna add is destined to be a discomfort = )
Best of luck and thanks for visiting StackOverflow!