# Capistrano Deployment and File Assets (pdfs, etc)

**URL:** <https://www.ruby-forum.com/t/capistrano-deployment-and-file-assets-pdfs-etc/72921>\
**Category:** Rails\
**Created:** [October 19, 2006, 10:36pm UTC](https://www.ruby-forum.com/t/capistrano-deployment-and-file-assets-pdfs-etc/72921 "2006-10-19T22:36:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lorenjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5a626/32.png) [@lorenjohnson](https://www.ruby-forum.com/u/lorenjohnson)\
**Post date:** [October 19, 2006, 10:36pm UTC](https://www.ruby-forum.com/t/capistrano-deployment-and-file-assets-pdfs-etc/72921/1 "2006-10-19T22:36:25Z")

</div>

I am trying to figure-out how to properly manage website file assets  
(pdfs, etc.) which are content on my site without having to have them  
part of my svn repository.

Right now when I deploy a new release using Capistrano the release only  
contains what was in my repository…

I guess I need to have capistrano create a symlink for my public/assets  
directory but I’m not sure how to go about that and can’t find docu’s  
anywhere that help.

I also prefere to manage my stylesheets and javascript separate from the  
Rails app in svn so I’d like these elsewhere.

Any advice? Can’t seem to find an answer to this anywhere.

Thanks,

Loren

---

<div class="post-metadata">

**Author:** ![lorenjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5a626/32.png) [@lorenjohnson](https://www.ruby-forum.com/u/lorenjohnson)\
**Post date:** [October 20, 2006, 12:23am UTC](https://www.ruby-forum.com/t/capistrano-deployment-and-file-assets-pdfs-etc/72921/2 "2006-10-20T00:23:55Z")

</div>

Loren J. wrote:

> I am trying to figure-out how to properly manage website file assets  
> (pdfs, etc.) which are content on my site without having to have them  
> part of my svn repository.
> 
> Right now when I deploy a new release using Capistrano the release only  
> contains what was in my repository…
> 
> I guess I need to have capistrano create a symlink for my public/assets  
> directory but I’m not sure how to go about that and can’t find docu’s  
> anywhere that help.

I use something like this in deploy.rb to link in my config files:

desc “Link in production database config and spin script”  
task :after\_update\_code do  
run \<\<-CMD  
ln -nfs #{deploy\_to}/#{shared\_dir}/config/database.yml  
#{release\_path}/config/database.yml  
CMD

run \<\<-CMD  
ln -nfs #{deploy\_to}/#{shared\_dir}/script/spin  
#{release\_path}/script/spin  
CMD  
end

Chris

---

<div class="post-metadata">

**Author:** ![lorenjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5a626/32.png) [@lorenjohnson](https://www.ruby-forum.com/u/lorenjohnson)\
**Post date:** [October 20, 2006, 1:58am UTC](https://www.ruby-forum.com/t/capistrano-deployment-and-file-assets-pdfs-etc/72921/3 "2006-10-20T01:58:09Z")

</div>

Another (simpler) way to ensure that your files are not wiped out with  
every  
update is to stored them in /public/system. This is a shared folder and  
isn’t wiped out with updates.

Hammed

---

<div class="post-metadata">

**Author:** ![lorenjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5a626/32.png) [@lorenjohnson](https://www.ruby-forum.com/u/lorenjohnson)\
**Post date:** [October 20, 2006, 3:38am UTC](https://www.ruby-forum.com/t/capistrano-deployment-and-file-assets-pdfs-etc/72921/4 "2006-10-20T03:38:00Z")

</div>

Hammed M. wrote:

> Another (simpler) way to ensure that your files are not wiped out with  
> every  
> update is to stored them in /public/system. This is a shared folder and  
> isn’t wiped out with updates.
> 
> Hammed

Hammed, that sounds just right. I’d noticed that system symlink but I  
was shy thinking it was being used for something else.

In the mean time this is what I came-up with for a solution. Lines I  
added to my deploy.rb

# 

=============================================================================

# TASKS

# 

=============================================================================  
desc “Restarting after deployment”  
task :after\_deploy, :roles =\> [:app, :db, :web] do

# run “mkdir /var/www/apps/shared\_assets”

run “ln -s #{deploy\_to}/…/shared\_assets  
#{deploy\_to}/current/public/assets”  
end

Relevant links:

[http://rubynoob.com/articles/2006/09/21/how-to-deploy-your-first-rails-app-to-dreamhost-using-capistrano-in-windows](http://rubynoob.com/articles/2006/09/21/how-to-deploy-your-first-rails-app-to-dreamhost-using-capistrano-in-windows)  
[http://atmos.org/2006/8/29/acts\_as\_attachment-walkthrough](http://atmos.org/2006/8/29/acts_as_attachment-walkthrough)

Thanks,

Loren
