Okay, based on Ryan's reply I wrote some rake tasks for deploying and  
rolling back that others might find helpful:
http://pastie.org/582587

It seems work just fine, however the rollback outputs this error:

-----> Heroku receiving push
-----> Launching.............. done
        http://darebusters.heroku.com deployed to Heroku

error: Trying to write non-commit object  
c5e59b4a052a7fec2ddc3b7922bd05c7c7272075 to branch refs/heads/master
To [email protected]:darebusters.git
  ! [remote rejected] release-20090813121841 -> master (failed to write)
error: failed to push some refs to '[email protected]:darebusters.git'

You'd think that meant the rollback failed, but it does work. I just  
don't understand the error. Anyone?

Cheers,
Casper



On 09/08/2009, at 19.28, Ryan Tomayko wrote:

>
> On Sun, Aug 9, 2009 at 10:17 AM, Casper
> Fabricius<[email protected]> wrote:
>> Hi,
>>
>> I know the Heroku guys (or at least Morten) probably thinks I'm
>> thinking too much in the "old" Capistrano terms, and that Heroku aims
>> to ensure that a deploy with errors should never get out there. Until
>> that happens, however, I'd like to be able to rollback my application
>> code on Heroku to a previous version.
>>
>> I believe the easiest way to do that is to tag each release, but (and
>> maybe this is really more of a Git than a Heroku question) I don't  
>> how
>> I'd make the remote Heroku repository "rollback" to a tag, while
>> keeping my local repository at HEAD. Is there a way? Does it makes
>> sense at all to get some peace of mind like this? :)
>>
>> What do other people do for this?
>
> You can roll back to a specific branch, tag, or even commit SHA with
> "git push -f". e.g., if you have the version you want to roll back to
> tagged as "previous":
>
>    git push -f heroku previous:master
>
> Or, you want to roll back three commits:
>
>   git push -f heroku HEAD~3:master
>
> Sometimes I just browse `git log' until I find the commit I want to go
> back to and then use the short SHA:
>
>   git push -f heroku a3fe67b:master
>
> This won't effect your working copy at all.
>
> This isn't exactly like capistrano's rollback, though. No attempt is
> made to rollback database migrations or anything like that. You will
> need to do that manually before pushing the previous version.
> Something like the following IIRC:
>
>    heroku rake db:migrate VERSION=20090901123000
>    git push -f heroku old-version:master
>
> Really insanely useful technique. We should document that somewhere.
>
> Thanks,
> Ryan
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to