Groups Images Directory Web
Recently Visited Groups | Help | Sign in
Google Groups Home
Group info
Members: 2119
Language: English
Group categories:
Computers > Software
Computers > Programming
More group info »
rails-deployment-step-by-step    

Rails deployment with Capstano step by step
Troy Will <troydwill@gmail.com> February 24, 2008
Note 1: These instructions were tested on a server running Debian. Non-Debian Apache configuration details will be differ
 

Assumptions:
0. Rails application deployed from a client onto a server.
1. Rails application name = my_app.
2. Server IP = AAA.BBB.CCC.DDD
3. Server hosts a MySQL database for the Rails application.
4. Server hosts a Subversion repository for the Rails application.
5. Server runs Apache.
6. Apache serves the Rails application through mongrel.
7. Capistrano version = 2.1.0.

Overview
Step A: Create a Subversion repository on the server.
Step B: Enable client access to the Subversion repository.
Step C: Create a basic Rails application on the client.
Step D: Import the Rails application from the client into the server based repository.
Step E: Create a /u/apps directory on server and change ownership.
Step F: Run capify to create two files: ./Capfile ./config/deploy.rb.
Step G: Edit ./config/deploy.rb.
Step H: Create a script/spin script ( Capistrano will run this script to launch the Rails application )

Step I: Run cap deploy:setup.
Step J: Run cap:deploy to deploy the Rails application from the client to the server.

Specific steps
Step A: Create a Subversion repository on the server.
            1.
            2.
            3.
Step B: Enable client access to the Subversion repository.
            1.
            2.
            3.
Step C: Create a basic Rails application on the client.
            1.
            2.
            3.
Step D: Import the Rails application from the client into the server based repository.
            1.
            2.
            3.
Step E: Create a /u/apps directory on server and change ownership.
            1.
            2.
            3.
Step F: Run capify to create two files: ./Capfile ./config/deploy.rb.
            1.
            2.
            3.
 

Step G: Edit ./config/deploy.rb.
            set :application, 'my_app'

            set :repository, 'svn://AAA.BBB.CCC.DDD/repository_name'

            set :runner, nil
 

            role :app, 'AAA.BBB.CCC.DDD'
            role :web, 'AAA.BBB.CCC.DDD'
            role :db,  'AAA.BBB.CCC.DDD', :primary => true

 
Step H: Create a script/spin script ( Capistrano will run this script to launch the Rails application )

 

            /u/apps/my_app/current/script/process/spawner -p 4000 -i 1

 

Step I: Run cap deploy:setup.
            1.
            2.
            3.
Step J: Run cap:deploy to deploy the Rails application from the client to the server.

Version: 
Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google