Capistrano’s configuration is managed through a set of magic variables. Some only take effect under certain circumstances, and others will affect all operations.
Please see the table below for more information:
:application |
Arbitrary variable, useful to store your application name within. |
:user |
The SSH username you are logging into the server(s) as. In collaborative development, you might not want to embed your own username here, since other developers might be deploying, too. [[Using SSH Keys]] is recommended. |
:password |
The SSH password you are logging into the server(s) with. It should be the password that matches the :user variable. It is generally not a good idea to hard-code this variable into the file, except while you are first getting familiar with Capistrano. It is much better idea to setup SSH public/private keys – in which case this variable does not need to be set at all. Again [[Using SSH Keys]] is recommended. |
:gateway |
Define a gateway server. All subsequent connections will be tunneled through the gateway (using SSH forwarded ports). |
:scm |
For specifying the type of source control system you are using. It is set to `git` by default. It is unnecessary to set it explicitly unless you are using something else. See the [[Source Control]] section for more info. |
:scm_username |
The username that your [[Source Control]] system will use to access the repository. |
:scm_password |
The password that your source control system (for ex: subversion) will use to access the repository. It is generally not a good idea to hard-code this variable into the file, except while you are first getting familiar with Capistrano. It is a better idea to investigate [[Using SSH Keys]]. Where [[Using SSH Keys]] is not an option [[SCM Credential Caching]] might be appropriate. |
:repository |
The URL of the repository that hosts our code for example http://github.com/capistrano/capistrano.git or git@github.com/capistrano/capistrano.git . If you are hosting the repository on your own. |
:local_repository |
The repository URL that should be used when querying from your workstation. If this is set, :repository , becomes the URL that should be used when querying the repository from the remote hosts. This is handy when you are accessing the repository via different methods locally vs. remotely: set :repository, “file:///var/svn/repos/my_app”A more thorough explanation is available at here. (20110817: Dead link) |
:deploy_to |
The path on the servers we’re going to be deploying the application to. For example /var/www/my-application . The default is /u/apps/ . |
:use_sudo |
Defines for the default Rails deployment recipes whether we want to use sudo or not. sudo is a unix tool for executing commands as the root user. To use it, your user must have password-less sudo access enabled. If you’re using shared hosting where sudo access may not be enabled for your user, you should set :use_sudo to false. In general, if you can get away without using sudo , you should avoid it. For example, 37signals now uses a system where they have a special deployment user, and always deploy as that user. |
:default_environment |
A hash that can be used to set environment variables that should be present for all commands that are executed, e.g.set :default_environment, { |
:migrate_env |
The environment in which to run Rails migrations, this has no default, and is thus the default of rake db:migrate . |
:rake |
The full path to rake on your system. Defaults to rake ; e.g. the current directory. |
:keep_releases |
The number of old releases to keep, defaults to 5, can be overridden with any positive integer, negative values will produce undefined behaviour. 0 means zero. The deploy:cleanup task is not run in the Default Deployment Behaviour, so you must run it manually or add it to your recipe. |