Guest User

Untitled

a guest
Jul 23rd, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. namespace :credibles do
  2. desc "Pre compiles assets"
  3. task :deploy => ['credibles:prep_heroku', 'assets:compile', 'credibles:push_heroku']
  4. task :prep_heroku do
  5. puts "Switching to staging branch...\n"
  6. system "git checkout -b staging || git checkout staging"
  7. puts "Checking heroku remote...\n"
  8. system 'git remote add heroku git@heroku.com:credibles.git || echo "remote exists"'
  9. puts "Pulling down heroku changes...\n"
  10. system 'git pull heroku master'
  11. puts "Merging in new changes...\n"
  12. system 'git merge master'
  13. end
  14. task :push_heroku do
  15. puts "Adding changed files..."
  16. system "git add -f public/stylesheets/*.css"
  17. system "git add -f public/javascripts/*.js"
  18. puts "Committing changes..."
  19. system 'git commit -m "Updating compiled assets" || echo "No asset changes"'
  20. puts "Pushing..."
  21. system 'git push heroku staging:master'
  22.  
  23. puts "Switching back to master..."
  24. system 'git checkout master'
  25. end
  26. end
Add Comment
Please, Sign In to add comment