Version control for my web server
Asked Answered
O

5

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.

Oust answered 30/6, 2010 at 23:44 Comment(2)
if you decide on a distributed version control system consider mercurial, which is used to maintain the web2py source code on Google CodeJoppa
Thanks Richard- looking at Mercurial vs Git now- Leaning Git but don't like the lack of Windows support...Oust
F
3

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.

Floeter answered 30/6, 2010 at 23:53 Comment(2)
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?Oust
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.Floeter
Z
3

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.

Zonate answered 30/6, 2010 at 23:52 Comment(0)
F
3

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.

Floeter answered 30/6, 2010 at 23:53 Comment(2)
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?Oust
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.Floeter
S
1

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.

Schreibman answered 1/7, 2010 at 0:1 Comment(1)
Thanks Aren- but what do you mean by "poor practice to point your production source into a repo"? I'm not clear on that.Oust
R
1

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.

Resolved answered 1/7, 2010 at 0:9 Comment(0)
A
0

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.

Anagram answered 30/6, 2010 at 23:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.