If you are using Capistrano 3 you can use the same method I explained in the answer to my own question here.
In essence, :shared_children
was how you'd do it in Capistrano 2, but it was removed in favor of :linked_files
and :linked_dirs
.
Just create your public/spree/
directory in your repository, add it to .gitignore
if you need to (it doesn't matter if they're tracked or not by Git), then edit your deploy.rb
to use :linked_dirs
:
set :linked_dirs, %w(public/spree)
This way, when Capistrano deploys it'll automatically create the directory in shared/
and link it into your current release. Please keep in mind that if you need files to be present in that directory you have to copy them to shared/
manually, using a tool like rsync
. The same goes for files like database.yml
(for which you'd use :linked_files
).