Variables

Variables

This comes from a grep of the 2.5.5 codebase, details should be added about what each variable means, but in case you wanted to know what was out there here they are.

basic

  • :application { abort "Please specify the name of your application, set :application, 'foo'" }
  • :repository { abort "Please specify the repository that houses your application's code, set :repository, 'foo'" }
  • :scm :subversion
  • :deploy_via :checkout
  • :deploy_to { "/u/apps/#{application}" }
  • :run_method { fetch(:use_sudo, true) ? :sudo : :run }

dirs

  • :current_dir "current"
  • :shared_dir "shared"
  • :version_dir "releases"

paths

  • :current_path { File.join(deploy_to, current_dir) }
  • :release_path { File.join(releases_path, release_name) }
  • :releases_path { File.join(deploy_to, version_dir) }
  • :shared_path { File.join(deploy_to, shared_dir) }

releases

  • :release_name { set :deploy_timestamped, true; Time.now.utc.strftime("%Y%m%d%H%M%S") }
  • :releases { capture("ls -xt #{releases_path}").split.reverse }
  • :latest_release { exists?(:deploy_timestamped) ? release_path : current_release }
  • :current_release { File.join(releases_path, releases.last) }
  • :previous_release { releases.length > 1 ? File.join(releases_path, releases[-2]) : nil }

revisions

  • :current_revision { capture("cat #{current_path}/REVISION").chomp }
  • :latest_revision { capture("cat #{current_release}/REVISION").chomp }
  • :previous_revision { capture("cat #{previous_release}/REVISION").chomp }
  • :revision { source.head }
  • :real_revision { source.local.query_revision(revision) { |cmd| with_env("LC_ALL", "C") { run_locally(cmd) } } }

other

  • :shared_children  %w(system log pids)
  • :source { Capistrano::Deploy::SCM.new(scm, self) }
  • :strategy { Capistrano::Deploy::Strategy.new(deploy_via, self) }