Welcome Guest, Not a member yet? Register   Sign In
Synchronizing .PHP Files on Production and Development Servers?
#8

[eluser]Phil Sturgeon[/eluser]
OK I know im dragging up old posts here, but I have found a perfect solution! 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:

Quote:ssh [email protected]

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

Quote:cd /home/user/public_html

3.) Then simply check the repo out.

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

DONT forget the "." at the end, otherwise you will get a folder in your root called trunk. The "." means this folder.

4.) When you look at your web root you will probably now see Internal Server Error 500 and start freaking out. Have no fear, chown is here!

The files you checked out master-less, like a Ronin wandering with no direction. The following command will let them know who's boss and set their owner/group.

Quote:sudo chown -R <username>:<username> ../public_html

What next?
To update your working copy, you can repeat steps 1 and 2 to log back in, then simple type:

Quote:svn update

It's very damn satisfying to watch the entire new site deploy in under 30 seconds, and you can rest assured that you didn't forget a file or delete the wrong thing.

Enjoy!


Messages In This Thread
Synchronizing .PHP Files on Production and Development Servers? - by El Forum - 10-02-2008, 03:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB