mbchowdari
Joined: 08 May 2008 Posts: 52
|
Posted: Wed Jun 03, 2009 2:53 pm Post subject: Capistrano in Ruby On Rails |
|
|
Capistrano is a utility that was created in order to reliably and
repeatable deploy Rails applications on remote servers. It uses SSH to communicate with the servers and execute commands on them. It is a wildly configurable tool, however, for simple deployments, it is straightforward to use. It’s somewhat like a turbocharged version of Rake in that Capistrano recipes are composed of a set of tasks to be performed. In Capistrano, however, tasks are set up with methods that will cause actions to happen on one or more remote servers.
Capistrano is opinionated software... it makes a few assumptions. The first is that you are deploying to a Unix-based system. The second is that your code is held in a repository that is accessible from both the machine you are deploying from and the machine to which you are deploying.
Setting Up a Deployment Environment:
setting up a recommended environment using the Apache web server with mod_proxy_balancer, Mongrel, and MySQL.
Step 1: Setting Up a Machine
your first job should be cleaning it up so that it’s ready. If it’s a PC, make sure it’s running the latest version of Linux.The next step is to install the various software components you need. The items you’ll need to install are
• The Apache 2.2 (or latest released version) web server
• MySQL 5.0 (or latest released version) database server
• Ruby 1.8.4 or later
• RubyGems to manage Ruby-based packages
• MySQL/Ruby library
• Ruby Termios Library (not on Windows)
.
Step 2: Setting Up Your Database
Once you have MySQL up and running on your server, you’ll need to do the following.
# On your database server
$ mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Deploy.rb
--------------
Other informations can be changed as is :
role :app, “yourdomain.com”
role :web, “yourdomain.com”
role :db, “yourdomain.com”
In Optional settings uncomment the lines :
set :deploy_to, “/home/username/application_name”
set :user, “username”
Important commands:
----------------------------
1) cap deploy:setup
2) cap deploy:check
3) cap deploy:update
4) cap deploy:start
Thank You, |
|