R
R
Robert2015-05-22 17:01:43
Ruby on Rails
Robert, 2015-05-22 17:01:43

How to correctly link to a folder with photos in capistrano 2?

Pictures are stored in directories of the following form:
public/uploads/item/image/1/thumb_6.jpg
In deploy.rb I wrote the following:
set : shared_children, shared_children + %w{public/uploads}
However, as it turned out, such a symlink does not work, the application does not see the picture.
How to do it right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Vsk, 2015-05-22
@Jowan

The first time I saw the :shared_children option was in the second version.
Usually, the required directory was removed from the git, put into shared, and the hook was hung:

after 'deploy:update_code', roles: :app do
  run "rm -f #{current_release}/public/uploads" # На всякий случай, если каким-то образом попал, например, симлинк
  run "ln -s #{deploy_to}/shared/public/uploads/ #{current_release}/public/uploads"
end

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question