Capistrano Deployment and File Assets (pdfs, etc)

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

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

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 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://atmos.org/2006/8/29/acts_as_attachment-walkthrough

Thanks,

Loren

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs