Configuration
Capistrano allows a great deal of configuration, and the options and methods available to you might seem overwhelming at first. Here's a list of most of the generally useful configuration methods that you can use.
Roles
- role
- Associates a role with multiple servers. Also lets you define dynamic roles that get their server lists at runtime.
- server
- Associates a server with multiple roles.
Tasks and Namespaces
- task
- Defines (or redefines) a new task that you can invoke via the Capistrano command-line utility, "cap".
- desc
- Associates a description with the next task that gets defined.
- namespace
- Defines (or reopens) a new namespace, within which you can define other namespaces and tasks.
- top
- Returns a reference to the topmost namespace.
- before
- Declare that some action or task should occur before another task.
- after
- Declare that some action or task should occur after another task.
Variables
Variables can be transparently referenced (though not assigned) in a Capistrano recipe file or task, simply by referencing them as if they were a local variable. Note, though, that to set a Capistrano variable you must resort to the set method.
- set
- Associates a value with a variable.
- unset
- Deletes a variable.
- fetch
- Returns the value of a variable, or a default value if the variable has not been set.
Execution
- transaction
- Begin a transaction, within which errors may trigger on_rollback clauses.
- on_rollback
- Specify code to be executed if an exception is raised within a transaction block.
- Return a reference to the task that is currently being executed.