use subversion to publish websites | Just my blog


use subversion to publish websites

Sometimes I'm really surprised about myself... especially how lazy I am. :-)

I'm currently playing around with one of my private websites, and to improve developing I decided to use subversion. So far so good, but I wanted that the committed subversion code was automatically online on the webserver. So I did the following very simple trick.

First I check out the code (subtree) from the subversion server (which is using https):

$ cd /sites
$ mv{,-backup}
$ svn co

Next step was to commit the current content of the website into subversion:

$ cd /sites/
$ cp -Rv /sites/*  ./
$ svn add *
$ svn commit -m "Initial commit of dev env"

Now download the simple script I created for making sure that subversion doesn't fire off twice for updating the same tree.

Download via this link.

So something like this:

$ mkdir ~/scripts/
$ cd ~/scripts
$ wget
$ chmod 700

Now... the last step... create a crontab entry with the following content:

*/1 * * * * /home/pieter/scripts/ /sites/ 2>&1 > /dev/null

 And guess... and it works like a charm, on every new commit done by whoever... you get your online site updated within 1 minute without the need log in into the website/webserver using ftp/ssh/whatever.

  • Social

  • By continuing to use the site, you agree to the use of cookies. more information

    The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible and enable advertising to provide you free content. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.