How do you update your web application on the server?
Asked Answered
L

5

7

I am aware of Capistrano, but it is a bit too heavyweight for me. Personally, I set up two Mercurial repositories, one on the production server and another on my local dev machine. Regularly, when a new feature is ready, I push changes from repository on my local machine to repository on the server, then update on the server. This is a pretty simple and quick way to keep files in sync on several computers, but does not help to update databases.

What is your solution to the problem?

Lousewort answered 1/9, 2008 at 12:56 Comment(0)
E
1

I used to use git push to publish to my web server but lately I've just been using rsync. I try to make my site as agnostic about where it's running as possible (using relative paths, etc) and so far it's worked pretty well. The only challenge is keeping databases in sync, and for that I usually use the production database as the master and make regular backups and imports into my testing database.

Echo answered 1/9, 2008 at 13:4 Comment(2)
I'm doing the same but lately it got me thinking that this is really not atomic. Not optimal for a website used constantly (people might access it at a broken stage where not all files have been rsynced yet).Popery
I'll add that a more optimal way of doing it is to rsync to a folder A while folder B contains your live website and then do the switch form A to B by overwriting a symlink that points to the current live version. And then next time, rsync to B.Popery
S
1

Or Fabric, if you prefer Python.

Salvatore answered 8/10, 2008 at 18:47 Comment(1)
More detail on fabric: #1234155Alnico
R
1

what's heavyweight about capistrano? if you want to sync files then sure rsync is great. but if you're then going to need to do db updates maybe cap isn't so bad ?

Revision answered 29/11, 2008 at 8:16 Comment(0)
E
0

@Andrew

To use git push to deploy your site you will need to do first set up a remote server in your .git/config file to push to. Then you need to configure a hook that will basically perform a git reset --hard to copy the code you just copied to the repository to the working directory.

I know this is a little vague, but I actually deleted the server-side .git folder once I switched to rsync, so I don't have the exact scripts that I used to make the magic happen. That might be a good candidate for a full question though, so you might get more responses that way.

edit: I know it's been a while, but I eventually found what I was using again:

Deploy a project using Git push

Echo answered 1/9, 2008 at 15:43 Comment(0)
T
0

I'm assuming you're speaking of Ruby on Rails.

Check out the HowTo wiki:

http://wiki.rubyonrails.com/rails/pages/Howtos#deployment

Timecard answered 3/10, 2008 at 19:29 Comment(1)
link is 404 nowAbernethy

© 2022 - 2024 — McMap. All rights reserved.