Created
May 1, 2010 11:31
-
-
Save lstoll/386254 to your computer and use it in GitHub Desktop.
This file contains 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 characters
desc "deploys to heroku" | |
task :heroku_deploy do | |
# create the git repo | |
`cd #{RAILS_ROOT} && mkdir .heroku_cache && cd .heroku_cache && git init` | |
# update files | |
`rsync -a --exclude=config/database.yml --exclude=.svn --exclude=.hg --exclude=.heroku_cache --delete #{RAILS_ROOT}/* #{RAILS_ROOT}/.heroku_cache/ ` | |
# git addremove | |
`cd #{RAILS_ROOT}/.heroku_cache && git add -A && git ls-files --deleted -z | xargs -0 git rm` | |
# git commit | |
`cd #{RAILS_ROOT}/.heroku_cache && git commit -m 'deploy commit'` | |
# git add remote | |
`cd #{RAILS_ROOT}/.heroku_cache && git remote add heroku [email protected]:ngipdatabase.git ` | |
# git force push | |
`cd #{RAILS_ROOT}/.heroku_cache && git push -f heroku master` | |
# migrate DB | |
`heroku rake db:migrate --app ngipdatabase` | |
puts "Done." | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment