Permalink
Browse files

Merge pull request #145 from fcheung/configurable_asset_roles

Allow configuration of which roles assets are precompiled on.
  • Loading branch information...
2 parents 8a2e093 + 0439805 commit 9f3e1e1fbed3a974cbe2bbe0d59268519e194ca6 @leehambley leehambley committed Apr 12, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/capistrano/recipes/deploy/assets.rb
@@ -2,6 +2,7 @@
_cset :asset_env, "RAILS_GROUPS=assets"
_cset :assets_prefix, "assets"
+_cset :assets_role, [:web]
_cset :normalize_asset_timestamps, false
@@ -18,7 +19,7 @@
for efficiency. If you cutomize the assets path prefix, override the \
:assets_prefix variable to match.
DESC
- task :symlink, :roles => :web, :except => { :no_release => true } do
+ task :symlink, :roles => assets_role, :except => { :no_release => true } do
run <<-CMD
rm -rf #{latest_release}/public/#{assets_prefix} &&
mkdir -p #{latest_release}/public &&
@@ -37,7 +38,7 @@
set :rails_env, "production"
set :asset_env, "RAILS_GROUPS=assets"
DESC
- task :precompile, :roles => :web, :except => { :no_release => true } do
+ task :precompile, :roles => assets_role, :except => { :no_release => true } do
run "cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile"
end
@@ -52,7 +53,7 @@
set :rails_env, "production"
set :asset_env, "RAILS_GROUPS=assets"
DESC
- task :clean, :roles => :web, :except => { :no_release => true } do
+ task :clean, :roles => assets_role, :except => { :no_release => true } do
run "cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:clean"
end
end

0 comments on commit 9f3e1e1

Please sign in to comment.