From 5dcebd7e3803c34b7e1aa1ed3577c9851dbee4a4 Mon Sep 17 00:00:00 2001 From: Richard Hulse Date: Wed, 13 Jul 2011 21:20:53 +1200 Subject: [asset pipeline] add capistrano task Task still needs to symlink default rails default filestore location, but code may still be settling --- railties/guides/source/asset_pipeline.textile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/guides/source/asset_pipeline.textile b/railties/guides/source/asset_pipeline.textile index 1cefe29e5e..640d02f6c1 100644 --- a/railties/guides/source/asset_pipeline.textile +++ b/railties/guides/source/asset_pipeline.textile @@ -261,7 +261,21 @@ The rake task is: rake assets:precompile -TODO: explain where to use this with Capistrano +You can run this as part of a Capistrano deployment: + + +before "deploy:symlink", "deploy:precompile_assets" + +desc "Compile pipeline assets" +task :precompile_assets do + run "#{release_path}; RAILS_ENV=#{rails_env} bundle exec rake assets:precompile" +end + + +If you are not precompiling your assets, and you are using the default cache file store (which is the filesystem), you will need to symlink +rails_root/tmp/cache/assets+ from the shared folder that is part of the Capistrano deployment structure. This is so the cached file persist between deployments. + +TODO: Extend above task to allow for this and add task to set it up (See commits 8f0e0b6 and 704ee0df). + The default matcher for compiling files is rather broad: -- cgit v1.2.3