Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Apr 16, 2010 12:36 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 06, 2009 9:02 pm
Posts: 54
Website: http://mark.watero.us/
Location: Las Vegas
Here's the scenario; I have a web site I want to mirror, so that there is a production and development copy of the same site. I want to work on the development copy transparently from the production copy.

I know you can use rsync to mirror a web site, but what if the two web sites are running on seperate domains and connecting to a different (though ultimately mirrored) database?

When I move features from the development version to the production, I would like to do so as seamlessly as possible. What should I be looking for?


Top
   
 Post subject:
PostPosted: Fri Apr 16, 2010 5:08 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
I use git for that.


Top
   
 Post subject:
PostPosted: Fri Apr 16, 2010 6:01 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 06, 2009 9:02 pm
Posts: 54
Website: http://mark.watero.us/
Location: Las Vegas
I did some quick googling on the subject but it looks like everybody is using it (for its intended use) as a version repo.

The problem that I see with that is pushing the repo onto the live site would either require putting the site into maintenance while I ran in to update the configuration (and point it at the right domain/db), or ... well that's about the only option.

Unless there's a way to build a git configuration that will grep my config files and do some replacements.


Top
   
 Post subject:
PostPosted: Fri Apr 16, 2010 8:17 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
If you first clone the development repo to the production repo, and change some configuration files on the production side, then those changes are likely be preserved when you merge the development repo into the production repo later on. Git doesn't blindly overwrite changed files unless you explicitly tell it do do so. That's the whole point of branching and merging, right?

If the database schema changes significantly, though, that would have to be dumped/reloaded or something like that. You'll probably need a few minutes of downtime there. Likewise, no version control system AFAIK guarantees that your repository will be in a consistent state while you're in the middle of a merge, so if that's really important, you might also want to take down the site during the few seconds while you're merging.


Top
   
 Post subject:
PostPosted: Fri Apr 16, 2010 11:01 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 06, 2009 9:02 pm
Posts: 54
Website: http://mark.watero.us/
Location: Las Vegas
I'm going to have to set up some test repositories and mess with this before I put it into use, but I'm definitely intrigued at the possibilities.

I've only used SVN to manage code that I'm the sole committer for, so the whole concept of merging is foreign to me at this point. I've found some pretty good documentation for git... I just hope I can also find some time to read it! :D


Top
   
 Post subject:
PostPosted: Fri Apr 16, 2010 11:58 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
This is what I do more or less

http://blog.obsidianproject.co.uk/2010/ ... sites.html


Top
   
 Post subject:
PostPosted: Sat Apr 17, 2010 3:01 am 
Offline
Senior Member
User avatar

Joined: Sun Dec 06, 2009 9:02 pm
Posts: 54
Website: http://mark.watero.us/
Location: Las Vegas
Thanks for that pointer obs. I'm two days out from launching a closed beta of a new site and I'm hoping to implement this during that period so that it's good from the get go.

Can't wait to see how bad I fudge up my site the first time I make a typo... :D


Top
   
 Post subject:
PostPosted: Sat Apr 17, 2010 4:12 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
What I tend to do is make my code portable across the test and live sites (relative paths etc) and keep configuration to one file which you can tell git to ignore.

One thing I like about the setup I showed you over using regular sftp is that when you stfp it overwrites the file on the server which can take a second or two during that time someone can get a messed up file. Using git it pushes to a repository then copies the file into place on the server which is almost instant.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group