views:

114

answers:

5

I'm building a Web2Py-based web application and am doing most of my development right on a remote EC2 development server. I would like to version control the entire system, including all python modules, web pages, and Apache config files. The files are obviously scattered across my Linux box, but I would like to be able to checkout/commit using a single command. I'm new to SVN on the command line- Is there a way to do this using a some sort of virtual directory with sym links?

Any thoughts are welcome. Thanks.

+3  A: 

If you've already started developing, the easy route would be to organize an SVN tree and then sym link the modules and httpd.conf. You could also make use of virtualenv and only check in the virtualenv config.

+2  A: 

For a single developer, Git ( book ) is better suited for convenience. You can "commit" locally very easily, and push changes to a remote server, which could be your EC2 instance, it just needs an SSH connection to work. But I would probably go with a hosted solution like GitHub or any other hosting solution that has SSH and the ability to install Git. I use GitHub for my public projects and DreamHost for my "private" projects.

You would put all your files in one directory structure and then deploy them using some automated process. For Python I would suggest something Python standard like distutils or even easy_install. For more complicated environments, you want to consider something like Chef, which will be extremely important if you start scaling out to more than a single EC2 instance. Even without the multiple server needs something like Chef for repeatable automated deployments is what an efficient developer does.

Just don't get tempted to write a "quick and dirty" shell script to do deployments, they are brittle and very un-maintainable. If you don't like Chef, research alternatives and take the time to learn one. The time spent will be made up for down the line.

fuzzy lollipop
Thanks Fuzzy, Git looks awesome- I hadn't considered it. So do you see an issue with me making my entire /var/www directory a Git repo? Also, why do you qualify it as "for a single developer"- Have you had issues with collaboration?
Yarin
for a single developer git vs svn, git wins, because it is simpler to setup, use and maintain. I think for a time git still wins, because configuration of svn is more complicated than git.
fuzzy lollipop
A: 

Ever think of ghosting the VM to S3? It's almost like the cloud version of "poor mans version control".

I have done the symlinking and although it is a good solution it is not the easiest to work with at first.

Gregory Kornblum
+1  A: 

Like fuzzy lolipop I would highly suggest git as well. Especially because of it's low taint footprint. SVN leaves .svn folders in each subfolder of your repo, this can get costly if your automated scripts copy/paste them around.

What i suggest is you have a central git repo and a publish script that checks out a version, then copies the files to their locations.

Alternatively

You could segment your repo out a bit and use symbolic links to wire up your website, however it's probably poor practice to point your production source into a repo, i'd still leverage the replication script method listed above.

Aren
Thanks Aren- but what do you mean by "poor practice to point your production source into a repo"? I'm not clear on that.
Yarin
+1  A: 

I personally use git for managing websites and config files.

I'm not sure if I would mix the apache configs and website in the same repo, but if I were to take that approach I'd do it in separate branches and set the remote appropriately.

Depending on what OS you're running, etckeeper is nice and integrates well with debian/apt based systems.

jkyle
Good suggestions- thanks
Yarin