What Is Capistrano?
Capistrano is an open source tool for running scripts on multiple
servers and it's main use is deploying web applications.
Written in the Ruby language and is distributed using the
RubyGems distribution channel.
It is implemented primarily for use on the bash command
The main functionality of the Capistrano is to Deploy the rails
application which you have already written.
Capistrano reads its instructions from Capfile (for those of you
familiar with the “make” or “rake” utilities, the concept is the same
as a “makefile” or “rakefile”). If you create a file called Capfile,
Capistrano will read that file and process the instructions in it.
The Capfile is where you will tell Capistrano about the servers you
want to connect to and the tasks you want to perform on those
servers. It is essentially just a Ruby script.
When we need to Deploy?
Whenever we make any changes in any of the components or files
which are part of the repository (like SVN, GIT) then we need to
This defines a single task, called “search_libs”, and says that it should be executed only
on the “domain” host. When executed, it will display all files and subdirectories in /usr/lib
that include the text “xml” in their name. By default, “run” will display all output to the
Assuming your capfile is in the current directory, you would execute that task like this
(from the command-line):
Capistrano tasks can be considered to be self-documenting, there are a couple of Rakeinspired ways to get a list of all the tasks Capistrano can run for a given installation:
If you were to add a task without a description, it would not be shown in this list, except
the verbose version: