Capistrano variables list

If you’re running Capistrano for deployment, you might be confused by its vairables, here’s a list of the variables that used by Capistrano:

  • application – required
  • repository – required
  • scm – defaults to :subversion
  • deploy_via – defaults to :checkout
  • revision – defaults to the latest head version
  • source – Capistrano::Deploy::SCM object
  • real_revision
  • strategy – Capistrano::Deploy::Strategy object defined by deploy_via
  • release_name – timestamp in the form of “%Y%m%d%H%M%S”
  • version_dir – defaults to ‘releases’
  • shared_dir – defaults to ‘shared’
  • shared_children – defaults to [‘system’, ‘log’, ‘pids’]
  • current_dir – defaults to ‘current’
  • releases_path – path of deploy_to + version_dir (e.g. /u/apps/example/releases )
  • shared_path – path of deploy_to + shared_dir (e.g. /u/apps/example/shared )
  • current_path – path of deploy_to + current_dir (e.g. /u/apps/example/current )
  • release_path – path of releases_path + release_name (e.g. /u/apps/example/releases/20111024024752 )
  • releases – list of releases, found by running ls -x
  • current_release – path of releases_path + last release (e.g. /u/apps/example/releases/20111024024752 )
  • previous_release – path of releases_path + previous release (e.g. /u/apps/example/releases/20111024024752 )
  • current_revision – revision id of the current release, found in the REVISION file
  • latest_revision – revision id of the latest release
  • previous_revision – revision id of the previous release
  • run_method – either :run or :sudo depending on if :use_sudo is set
  • latest_release – release path or the current release depending on if the current symlink is valid

All of these variables come from lib/capistrano/recipes/deploy.rb.

Note That: The above page is a copied version from, and the original post can be found here.

Additinally if you’re running Webistrano in front of Capistrano, here is the variable list for Webistrano:


I was facing a problem after updating Webistrano to the very latest version. The major change is that Gems are managed by Bundler. According to Capistrano’s changelog, the variable current_release does not handle well by Bundler,  then you just need to use release_path instead.

Share this post

2 thoughts on “Capistrano variables list

  1. Your blog is really cool to me and your topics are very relevant. I was browsing around and came across something you might find interesting. I was guilty of 3 of them with my sites. “99% of blog managers are guilty of these five errors”. You will be suprised how simple they are to fix.

Post Comment