Skip to content

Instantly share code, notes, and snippets.

View freegenie's full-sized avatar

Fabrizio Regini freegenie

View GitHub Profile
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]
@freegenie
freegenie / paperclip.rake
Created June 8, 2012 09:54 — forked from mrrooijen/paperclip.rake
A Fix for Paperclip Rake Task (paperclip:refresh:thumbnails) - Compatible with ActiveRecord and Mongoid
module PaperclipMongoidPatch
class << self
def obtain_class
class_name = ENV['CLASS'] || ENV['class']
raise "Must specify CLASS" unless class_name
@klass = Object.const_get(class_name)
end
def obtain_attachments
name = ENV['ATTACHMENT'] || ENV['attachment']