Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Deploy and Rollback an App Release

Here are the command-line snippets used in this lesson:

$ heroku releases
$ heroku releases:info v<release-number>
$ heroku releases:output v<release-number>
$ heroku maintenance:on
$ heroku open
$ heroku maintenance:off
$ heroku maintenance
$ heroku rollback v<release-number>
$ heroku releases

00:00 In this short lesson, you’ll learn about Heroku releases. You can think of them as the subsequent versions of your app. They combine the code, the environment variables, and the attached add-ons such as the PostgreSQL database discussed in the previous lesson.

00:18 Every time you modify one of those by either pushing the code or changing the configuration, Heroku will make a new app release and increment its ID. You’ll always see the latest release at the top of this chronological list.

00:34 In this case, the most recent release was version 16. To find more details about a particular release, you can type the info subcommand followed by the release number.

00:47 It will tell you who triggered the build, when, which Git commit ended up running in the cloud, and what were the associated resources and metadata. This helps figure out what’s changed between the releases and troubleshoot any potential problems.

01:03 You can also investigate the output of the release process defined in your Procfile.

01:10 If something goes wrong and the app stops working after a new deployment, then you can prevent more damage by enabling a temporary maintenance mode.

01:24 When users visit your app, they’ll see a nice message instead of causing a catastrophic failure. To turn it off again, just type heroku maintenance:off.

01:42 Alternatively, you can quickly do a rollback to any previous release with a single command.

01:51 If you’ve ever tried to perform such a task elsewhere, then you’ll appreciate how straightforward it is on Heroku. Notice, however, that Heroku keeps a record of all the previous releases and rollbacks to preserve the complete history and give you the big picture, so rolling back actually creates a brand new release with the same code and metadata as one of the earlier releases. Nevertheless, it will receive the next version number and land at the top of the list of releases. All right, that’s all you need to know about Heroku releases at this point.

Become a Member to join the conversation.