Skip to content

Instantly share code, notes, and snippets.

@mrkurt
Created February 22, 2011 23:19
Show Gist options
  • Save mrkurt/839648 to your computer and use it in GitHub Desktop.
Save mrkurt/839648 to your computer and use it in GitHub Desktop.
an ugly task for processing compass and whatnot, then deploying them to heroku
namespace :credibles do
desc "Pre compiles assets"
task :deploy => ['credibles:prep_heroku', 'assets:compile', 'credibles:push_heroku']
task :prep_heroku do
puts "Switching to staging branch...\n"
system "git checkout -b staging || git checkout staging"
puts "Checking heroku remote...\n"
system 'git remote add heroku [email protected]:credibles.git || echo "remote exists"'
puts "Pulling down heroku changes...\n"
system 'git pull heroku master'
puts "Merging in new changes...\n"
system 'git merge master'
end
task :push_heroku do
puts "Adding changed files..."
system "git add -f public/stylesheets/*.css"
system "git add -f public/javascripts/*.js"
puts "Committing changes..."
system 'git commit -m "Updating compiled assets" || echo "No asset changes"'
puts "Pushing..."
system 'git push heroku staging:master'
puts "Switching back to master..."
system 'git checkout master'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment