views:

157

answers:

2

I'm completely new to Linux, but today I find myself setting up a server (Ubuntu 10.04 LTS lucid) from scratch to host a Rails application.

Anyway, I managed to get a Rails app up and running on the server itself, but I had to scrap that because I want to use Git. So I setup a git repository on the server, then pushed all the code from my local machine to the repository. Buuuut, of course Git doesn't actually store the files themselves in the repository -- all the code for my Rails app is now only on my local machine. How am I supposed to tell the server to host that?

Right now my solution is to have the server use git to pull the code from its own repository. That's the code I'll host for all the world to see. In order to update the code, I guess I'll have to do something like this:

  1. Update the code on my local machine.
  2. Do some git adds, git commits, and a git push.
  3. On the server, do a git pull to update the code.

So my question is, am I doing this the right way?

+1  A: 

I recommend that you use Capistrano to deploy your application to your slice. Slicehost have some excellent guides available on this.

John Topley
+1 for this. Capistrano is absolutely the way to go - especially as a starting point.
mylescarrick
Thanks, I'll check it out.
NudeCanalTroll
A: 

Cap is solid and is common practice for Rails apps. Check it out for sure.

I also highly suggest Github to host your repo. It's really inexpensive and provides a ton of value. The simplest workflow for the situation you described would be to push the repo you have on your development machine up to github. Then, from your server, clone the github repo onto your server.

As you develop, keep pushing incremental changes up to github. When you're ready to release an update, simply git pull from your server and it will pull in all the changes you've made.

Bryce