Get the path to the capistrano shared path from ruby

I know that I can set the location of my rail application with Rails.root:

> Rails.root
 => #<Pathname:/var/www/app-name/releases/20150507181426>

I am looking for a function to call to get the capistrano shared folder, which in this case is here:

/var/www/app-name/shared/

I need to be able to get the path from ruby ​​code. Thanks in advance.

+4
source share
2 answers

You really don't need to know what the general path of Capistrano is. During the deployment process, you were expected to create links to any directories that are shared for the deployment.

The variable linked_dirsdefines this:

set :linked_dirs, %w[ example ]

, releases/NNN/example shared/example. .

Update:

, , , , .

.

+5

capistrano shared_path ( capistrano v2 v3).

:

puts "#{shared_path}"
=> /DEPLOY_PATH/APP_NAME/shared

, , capistrano v3.


, capistrano libs (deploy.rb : development.rb, staging.rb, production.rb,...) capistrano rake ( , on role(:app) do {...}).

+2

All Articles