Skip to content

Instantly share code, notes, and snippets.

@andyferra
Created June 16, 2009 23:21
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andyferra/130977 to your computer and use it in GitHub Desktop.
Save andyferra/130977 to your computer and use it in GitHub Desktop.
Consolidate pre-deployment tasks before shipping to Heroku
namespace :heroku do
desc "Deploy to Heroku"
task :deploy => :prepare_deployment do
system <<-EOF
git push heroku master
EOF
end
task :update_asset_packages do
system <<-EOF
rake asset:packager:build_all
git commit -am 'updated packaged assets'
EOF
end
task :update_sass do
system <<-EOF
rake sass:update
git commit -am 'updated stylesheets and assets'
EOF
end
task :prepare_deployment do
system <<-EOF
rake heroku:update_asset_packages
rake heroku:update_sass
EOF
end
end
# Supresses automatic updates of SASS so as not to offend your Heroku slug
Sass::Plugin.options[:never_update] = true
namespace :sass do
desc 'Update SASS Stylesheets'
task :update => :environment do
Sass::Plugin.update_stylesheets
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment