Sunday, July 27, 2008

Deploying Rails Application in Morph AppSpace

Deploy your Rails applications in a fault-tolerant environment

with load balancers, private database, backups, and monitoring
— instantly expandable on the fly in case you get slashdotted.

Deploying your Rails application to a Morph AppSpace is a snap.
You create an account and then download a pre-configured Capistrano
recipe. Make a quick update of your SVN location and run the CAP command.
That’s it. Within a few minutes, your application is up and running,
ready for the world. (taken from Mor.ph)


I know you are quite familiar with Morph AppSpace
and this is just a quick simple steps on how to do deploy
your rails application in Morph.

Assumptions:


1. Your are using Subversion in your Rails application,
if not refer to this post.

2. You need to have an existing Morph Account, if none
you can sign-up for free here.

3. You have already installed Capistrano.

4. Deploying should be done in Linux environment (currently)

*Updated: I first tried deploying the application using Windows but it had errors during deployment. Since I had Linux and the deployment in Linux is pretty sweet with no errors at all, that's why I assumed it won't work for Windows.

But hey am wrong hehehe :) you need to tweak things in Windows (as usual) to make it work.

Steps:

1. Go to Morph Panel and create a new subscription

2. Click "Create Data Base". This will create an initial database setup
for your application.

3. Click "Download CAP File". This is the pre-configured Capistrano recipe
that Morph created for deploying your rails application.

4. Update the CAP(Capistrano) file, by setting your repository location.
e.g.
set :repository, nil => set :repository, 'http://svn.exist.com/svn/railsapp/trunk'

5. Run the CAP file.
>> cap -f morph_deploy.rb morph:deploy

a. This will get the application's code in svn.
b. If prompted for Morph Authentication, enter your Morph username/password.
c. Then this will upload the code in a S3.
d. If message is "Code upload is Done", your application is now ready for the world.

You can access it using the domain you specified in your subscription.
e.g http://your_apps_domain.morphexchange.com/
Your rails application is now available 24/7 via Morph AppSpace! Laughing

0 comments: