Phil Sturgeon

Deploying sites with SVN

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

Gravatar

2010-04-02

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

Gravatar

2010-04-04

@Aleks: There's another article for that.

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

Post a comment


twiDAQ

Join the awesome twiDAQ game and invest in people you think are interesting. Invest in me:

Otherwise you can try investing in Jimbo:

He probably rigged it for him to win anyway.