Trigger migrations and run shell commands after Heroku deployments
We've been working on many cool things recently, some of them are deployed and blog posts are pending, some of them will be deployed soon. Today we're releasing one of the things that got us really excited.
Many users who deploy their apps to Heroku eventually hit a moment when they want to run database migrations as part of their deployment. In most cases even if you have automated deployments, it's still a command that you have to execute from the command line manually. Today we're releasing an update that finally allows you to completely automate this process.
This is the same post-deployment commands feature that we support in most of our deployments, but the difference is that the commands will be executed the same way that heroku run
console command runs them — in a dyno temporarily created in your environment.
The commands will be executed as one script and our regular substitution variables will also be available, greatly extending the range of what you can do with this feature.
We hope you find this feature useful and hope that it brings your deployment process closer to a perfect goal of complete automation and predictability, for your peace of mind and uninterrupted experience of your users. If there's something else we could do to help make your deployment workflow better, please let us know in the comments or through our support.