Skip to content

2.x DSL Documentation Configuration Module

Lee Hambley edited this page Oct 4, 2010 · 1 revision

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:

Roles

  • role Associates a role with multiple servers. Also lets you define dynamic roles that get their server lists at run-time. (more...)
  • server Associates a server with multiple roles. (more...)

Tasks & Namespaces

  • task Defines (or redefines) a new task that you can invoke via the Capistrano command-line utility, "cap". (more...)
  • desc Associates a description with the next task that gets defined. (more...)
  • namespace Defines (or reopens) a new namespace, within which you can define other namespaces and tasks. (more...)
  • top Returns a reference to the topmost namespace. (more...)
  • before Declare that some action or task should occur before another task. (more...)
  • after Declare that some action or task should occur after another task. (more...)

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. See also Configuration Variables.

  • set() Associates a value with a variable. (more...)
  • unset() Deletes a variable. (more...)
  • exists?() Queries whether a variable has been set. (more...)
  • fetch() Returns the value of a variable, or a default value if the variable has not been set. (more...)

Execution

  • transaction() Begin a transaction, within which errors may trigger on_rollback clauses. (more...)
  • on_rollback() Specify code to be executed if an exception is raised within a transaction block. (more...)
  • current_task() Return a reference to the task that is currently being executed. (more...)
  • find_and_execute_task Execute a specified task at fully-qualified path. (more...)
Clone this wiki locally