views:

57

answers:

2

Hi all,

A friend of mine and I are developing a web server for system administration in perl, similar to webmin. We have a setup a linux box with the current version of the server working, along with other open source web products like webmail, calendar, inventory management system and more.

Currently, the code is not under revision control and we're just doing periodic snapshots. We would like to put the code under revision control. My question is what will be a good way to set this up and software solution to use:

One solution i can think of is to set up the root of the project which is currently on the linux box to be the root of the repository a well. And we will check out the code on our personal machines, work on it, commit and test the result.

Any other ideas, approaches?

Thanks a lot,

Spasski

+1  A: 

Version Control with Subversion covers many fundamental version control concepts in addition to being the authority on Subversion itself. If you read the first chapter, you might get a good idea on how to set things up.

In your case, it sounds like you're making the actual development on the live system. This doesn't really matter as far as a version control system is concerned. In your case, you can still use Subversion for:

  1. Committing as a means of backing up your code and updating your repository with working changes. Make a habit of committing after testing, so there are as few broken commits as possible.
  2. Tagging as a means of keeping track of what you do. When you've added a feature, make a tag. This way you can easily revert to "before we implemented X" if necessary.
  3. Branching to developt larger chunks of changes. If a feature takes several days to develop, you might want to commit during development, but not to the trunk, since you are then committing something that is only half finished. In this case, you should commit to a branch.

Where you create a repository doesn't really matter, but you should only place working copies where they are actually usable. In your case, it sounds like the live server is the only such place.

For a more light-weight solution, with less overhead, where any folder anywhere can be a repository, you might want to use Bazaar instead. Bazaar is a more flexible version control system than Subversion, and might suit your needs better. With Bazaar, you could make a repository of your live system instead of setting up a repository somewhere else, but still follow the 3 guidelines above.

bzlm
Thanks, I've read part of this book and have experience with svn, but here the issue is that we cannot test the code on our copy of the repository. The only possibility is to test it after commiting.
Spasski
@Spasski I've updated my answer.
bzlm
that's really helpful peace of advice. I appreciate it!
Spasski
A: 

How many webapp instances can you run?

You shouldn't commit untested code, or make commits from a machine that can't run your code. Though you can push to backup clones if you like.

Tobu
Only one. The server is still not on production and we can afford to break the code. Typically the way we work is ssh to the machine and work directly there and test the result in a browser. As we are going to be just to developersm, I am thinking a local repository solution would be best with periodic backup on another machine.I just curious if anybody has had similar experience and their thoughts
Spasski
@Spasski I'd go with sharing a repo on the server then, setting up a few aliases to sort out who committed what. But I haven't been in that situation, as a rule I've been able to run locally first. A completely different solution that does push deployments à la capistrano/heroku/toppcloud might also work, though I'd expect breakage on most commits.
Tobu