Created
July 17, 2012 16:03
-
-
Save kommen/3130297 to your computer and use it in GitHub Desktop.
Revisions
-
kommen revised this gist
Jul 17, 2012 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ set :branch, "origin/#{ENV['BRANCH'] || "master"}" namespace :assets do desc "Precompile rails 3.1 assets" task :precompile, :except => { :no_release => true } do -
kommen revised this gist
Jul 17, 2012 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,3 +10,10 @@ end end namespace :deploy do desc "Update the deployed code." task :update_code, :except => { :no_release => true } do run("cat #{current_path}/REVISION") { |c,s,d| set(:deployed_revision, d[0,7]) } run("cd #{current_path}; git fetch origin; git reset --hard #{branch}; git submodule update --init;echo '#{branch}' > #{current_path}/BRANCH; git rev-parse #{branch} > #{current_path}/REVISION") end end -
kommen created this gist
Jul 17, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ namespace :assets do desc "Precompile rails 3.1 assets" task :precompile, :except => { :no_release => true } do asset_paths = "app/assets lib/assets vendor/assets" if !ENV['FORCE_PRECOMPILE'].nil? || capture("cd #{current_path}; git diff-tree --name-only -r #{deployed_revision} HEAD #{asset_paths} | wc -l").strip.to_i > 0 deploy.precompile_assets else logger.info "Skipping asset pre-compilation because there were no asset changes" end end end