0

What I would like to do is point the webroot from my dev webserver to some dir that is in some way linked to svn so when I commit changes they will be automatically visible on my dev webserver.

Any clue how I can do this?

EDIT

i'm creating a django project so i'm justing the Django development server

1
  • what is your dev web server? IIS? Apache?
    – Rohith
    Sep 23, 2010 at 14:27

3 Answers 3

3

You can make your wwwroot a working copy of the svn repository, by checking it out from the server. To get the automatic updates working, you'll either have to look into a post-commit hook or have a cron job (or similar) run a task to update the wwwroot every X minutes or so.

2
  • Or you could have a continuous integration process listen for commits and update your working copy.
    – Rohith
    Sep 23, 2010 at 14:29
  • 2
    Either method you choose, it would be beneficial to consider (assuming your server is Apache) using a .htaccess file to disallow access to the contents of your .svn directory. Sep 23, 2010 at 15:19
2

Generally, you will want to check your website out into a directory that you use as your web root, and then set up a Subversion post-commit hook that will check out the latest version into that directory every time someone commits a new version.

1
  • Exactly, the web server cannot look at VCS repository and decide which versions will be current for the website or even read them as php or css or html files. A simple way would be to script the process of checking out from the latest release to the target server and a more sophisticated way would be to go for CI (Continuous Integration) with a tool like Hudson. Sep 23, 2010 at 14:52
1

Having a production server auto-update is probably not a great idea. But if you'd like to do that with dev boxes, look into a continuous integration service like Hudson. It can watch your source repository and automatically update one or more working copies every time you commit code. If you have any other work which needs to be done (eg, execute builds, restart daemons/services, flush some caches, etc.), this can do that work as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.