There are several helper methods that Capistrano provides for you to use in your recipes. These helpers vary in purpose from executing commands, to transferring files, to manipulating the output of a command:
role
Associates a role with multiple servers. Also lets you define dynamic roles that get their server lists at run-time. ([[more...|2.x-DSL-Configuration-Roles-Role]])server
Associates a server with multiple roles. ([[more...|2.x-DSL-Configuration-Roles-Server]])
task
Defines (or redefines) a new task that you can invoke via the Capistrano command-line utility, "cap". ([[more...|2.x-DSL-Configuration-Tasks-Task]])desc
Associates a description with the next task that gets defined. ([[more...|2.x-DSL-Configuration-Tasks-Desc]])namespace
Defines (or reopens) a new namespace, within which you can define other namespaces and tasks. ([[more...|2.x-DSL-Configuration-Tasks-Namespace]])top
Returns a reference to the topmost namespace. ([[more...|2.x-DSL-Configuration-Tasks-Top]])before
Declare that some action or task should occur before another task. ([[more...|2.x-DSL-Configuration-Tasks-Before]])after
Declare that some action or task should occur after another task. ([[more...|2.x-DSL-Configuration-Tasks-After]])
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. See also [[Configuration Variables|2.x-Significant-Configuration-Variables]].
set()
Associates a value with a variable. ([[more...|2.x-DSL-Configuration-Variables-Set]])unset()
Deletes a variable. ([[more...|2.x-DSL-Configuration-Variables-Unset]])exists?()
Queries whether a variable has been set. ([[more...|2.x-DSL-Configuration-Variables-Exists]])fetch()
Returns the value of a variable, or a default value if the variable has not been set. ([[more...|2.x-DSL-Configuration-Variables-Fetch]])
transaction()
Begin a transaction, within which errors may trigger on_rollback clauses. ([[more...|2.x-DSL-Configuration-Execution-Transaction]])on_rollback()
Specify code to be executed if an exception is raised within a transaction block. ([[more...|2.x-DSL-Configuration-Execution-On-Rollback]])current_task()
Return a reference to the task that is currently being executed. ([[more...|2.x-DSL-Configuration-Execution-Current-Task]])find_and_execute_task
Execute a specified task at fully-qualified path. ([[more...|2.x-DSL-Configuration-Execution-Find-And-Execute-Task]])