Phil Sturgeon

Web developer, kayaker, outdoors madman and part-time alcoholic.


Deploying sites with SVN

Posted SVN at Oct 02, 2008

I have a working copy on my dev site and the live site. live will be trunk, dev will be the branch I am working on or trunk depending on what I want to test on that enviroment.

It might sound a little nuts, but having SVN working copy on your server means you can easily deploy the new version of the site. Commit your local changes to the repo, then just SSH in and update!

This step-by-step guide will assume SVN binaries are already installed and you have SSH access.

1.) Log in via Putty or Terminal:

ssh user@yoursite.com

2.) Get to your public_web root. This will probably be something like /home/user/public_html/ but could vary.

cd /home/user/public_html

3.) Then simply check the repo out.

svn co http://svn.whatever.com/repo/trunk .

DONT forget the full stop as that says to use the current directory and not create a new sub-directory.

4.) Do work.

5.) Update your site:

svn update

And there you have it. Each update you make will be deployed to your site when you run the svn update, minimum fuss.

Comments

User comments
  • Gravatar Phil Sturgeon

    Apr 04, 2010

    @Aleks: There's another article for that.

    http://philsturgeon.co.uk/news/2009/01/How-to-Support-multiple-production-environments-in-CodeIgniter

  • Gravatar Aleks Dorohovich

    Apr 02, 2010

    And how about differences in database config on local copy and on live site?

Post a comment